This is an automated email from the ASF dual-hosted git repository. zhongjiajie pushed a commit to branch 3.0.5-prepare in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
commit a7fc67faed87a7ab028412e61300dac76b527cf8 Author: HomminLee <[email protected]> AuthorDate: Thu Mar 30 09:56:57 2023 +0800 [Fix-13657][Master]NPE caused by the execution of workflow with startNode and forbidden task (#13668) Co-authored-by: HomminLee <[email protected]> (cherry picked from commit fba59981d41f0c078e409fcf3a036f138dd686d6) --- .../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 fda109e1f4..6af96d1630 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 @@ -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 {
