From c5a5ff7a74b7f4dcf7b306476e5c210623a62a22 Mon Sep 17 00:00:00 2001 From: HomminLee Date: Thu, 30 Mar 2023 09:56:57 +0800 Subject: [PATCH] [Fix-13657][Master]NPE caused by the execution of workflow with startNode and forbidden task (#13668) Co-authored-by: HomminLee --- .../server/master/runner/WorkflowExecuteRunnable.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java index 4cbfb3b826..57a624d8f6 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java @@ -1419,8 +1419,11 @@ public class WorkflowExecuteRunnable implements Callable { */ private void setIndirectDepList(String taskCode, List indirectDepCodeList) { TaskNode taskNode = dag.getNode(taskCode); - List 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 {