[Fix-13657][Master]NPE caused by the execution of workflow with startNode and forbidden task (#13668)

Co-authored-by: HomminLee <lihongmin@ysstech.com>
(cherry picked from commit fba59981d4)
This commit is contained in:
HomminLee 2023-03-30 09:56:57 +08:00 committed by Jay Chung
parent 48a8a230d8
commit a7fc67faed
1 changed files with 5 additions and 2 deletions

View File

@ -1352,8 +1352,11 @@ public class WorkflowExecuteRunnable implements Callable<WorkflowSubmitStatue> {
*/
private void setIndirectDepList(String taskCode, List<String> indirectDepCodeList) {
TaskNode taskNode = dag.getNode(taskCode);
List<String> depCodeList = taskNode.getDepList();
for (String depsNode : depCodeList) {
// If workflow start with startNode or recoveryNode, taskNode may be null
if (taskNode == null) {
return;
}
for (String depsNode : taskNode.getDepList()) {
if (forbiddenTaskMap.containsKey(Long.parseLong(depsNode))) {
setIndirectDepList(depsNode, indirectDepCodeList);
} else {