Browse Source

add null check when import process has sub-process (#1806)

* fix bug: zk hasTask method NPE

* add retMap null check for AlertSender

* add null check when import process has sub-process
pull/2/head
Yelli 5 years ago committed by qiaozhanwei
parent
commit
38f30b5c4d
  1. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java

@ -802,6 +802,8 @@ public class ProcessDefinitionService extends BaseDAGService {
JSONObject subParams = JSONUtils.parseObject(taskNode.getString("params"));
Integer subProcessId = subParams.getInteger("processDefinitionId");
ProcessDefinition subProcess = processDefineMapper.queryByDefineId(subProcessId);
//check is sub process exist in db
if (null != subProcess) {
String subProcessJson = subProcess.getProcessDefinitionJson();
//check current project has sub process
ProcessDefinition currentProjectSubProcess = processDefineMapper.queryByDefineName(targetProject.getId(), subProcess.getName());
@ -861,7 +863,7 @@ public class ProcessDefinitionService extends BaseDAGService {
subParams.put("processDefinitionId", newSubProcessDefine.getId());
taskNode.put("params", subParams);
}
}
}
}
}

Loading…
Cancel
Save