fix possible npe when creating job executions
@@ -460,7 +460,9 @@ public class JpaBatchJobExecution implements BatchJobExecution {
JpaBatchJobExecutionParameter feedNameRefParam = null;
JpaBatchJobExecutionParameter jobTypeParam = null;
- for (BatchJobExecutionParameter p : getJobParameters()) {
+ Set<BatchJobExecutionParameter> jobParams = getJobParameters();
+ if (jobParams != null) {
+ for (BatchJobExecutionParameter p : jobParams) {
if (FeedConstants.PARAM__FEED_NAME.equalsIgnoreCase(p.getKeyName())) {
feedNameRefParam = (JpaBatchJobExecutionParameter) p;
} else if (FeedConstants.PARAM__JOB_TYPE.equalsIgnoreCase(p.getKeyName())) {
@@ -471,6 +473,7 @@ public class JpaBatchJobExecution implements BatchJobExecution {
break;
}
}
+ }
if (feedNameRefParam == null) {
feedNameRefParam = addParameter(FeedConstants.PARAM__FEED_NAME, feedNameReference);
