zuzuviewer commented on code in PR #14199:
URL: 
https://github.com/apache/dolphinscheduler/pull/14199#discussion_r1205136768


##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java:
##########
@@ -306,12 +306,16 @@ public void init(String host, Date startTime, String 
executePath) {
     }
 
     public DependentParameters getDependency() {
-        if (this.dependency == null) {
+        if (this.dependency == null && 
TASK_TYPE_DEPENDENT.equalsIgnoreCase(this.taskType)) {
             Map<String, Object> taskParamsMap =
                     JSONUtils.parseObject(this.getTaskParams(), new 
TypeReference<Map<String, Object>>() {
                     });
+            Object dependence = taskParamsMap.get(Constants.DEPENDENCE);
+            if (dependence == null) {
+                return null;
+            }

Review Comment:
   And I think other stage must check it for avoid NPE, because can't guarantee 
it's not null in the downstream stage even though return not null value in here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to