QuantumXiecao commented on code in PR #13622:
URL: 
https://github.com/apache/dolphinscheduler/pull/13622#discussion_r1117881729


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java:
##########
@@ -1073,7 +1072,8 @@ public Result<Object> delete(User loginUser, String 
fullName,
         if (resourcesNeedToDeleteSet.size() > 0) {
             for (ResourcesTask resourcesTask : resourcesNeedToDeleteSet) {
                 int taskId = resourcesTask.getTaskId();
-                if 
(processService.isTaskOnline(taskDefinitionMapper.selectById(taskId).getCode()))
 {
+                TaskDefinition taskDefinition = 
taskDefinitionMapper.selectById(taskId);
+                if (taskDefinition != null && 
processService.isTaskOnline(taskDefinition.getCode())) {

Review Comment:
   You mean the restriction on deleting has no meaning because users could 
directly delete files which is stored in third-party storage system. So here we 
do not add check just let the users go ahead. When users invoke task, they 
would find the referenced resource file not existing error log. I think I got 
your point and I modify my PR again. Thanks for your remind!



-- 
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