Skip to content

Commit fba5998

Browse files
authored
[Fix-13657][Master]NPE caused by the execution of workflow with startNode and forbidden task (#13668)
Co-authored-by: HomminLee <[email protected]>
1 parent 9d9ae9a commit fba5998

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,8 +1513,11 @@ private DependResult isTaskDepsComplete(String taskCode) {
15131513
*/
15141514
private void setIndirectDepList(String taskCode, List<String> indirectDepCodeList) {
15151515
TaskNode taskNode = dag.getNode(taskCode);
1516-
List<String> depCodeList = taskNode.getDepList();
1517-
for (String depsNode : depCodeList) {
1516+
// If workflow start with startNode or recoveryNode, taskNode may be null
1517+
if (taskNode == null) {
1518+
return;
1519+
}
1520+
for (String depsNode : taskNode.getDepList()) {
15181521
if (forbiddenTaskMap.containsKey(Long.parseLong(depsNode))) {
15191522
setIndirectDepList(depsNode, indirectDepCodeList);
15201523
} else {

0 commit comments

Comments
 (0)