[Fix-13596][Task Instance] Throw an error message to tell the user that the file cannot be found instead of NPE during task execution (#13878)
Co-authored-by: lijie0203 <guoxiaoliang@qishudi.com>
This commit is contained in:
parent
7e134b24ef
commit
8829bea86d
|
|
@ -1772,9 +1772,7 @@ public class ProcessServiceImpl implements ProcessService {
|
|||
JSONUtils.toJsonString(mainJarObj),
|
||||
ResourceInfo.class);
|
||||
ResourceInfo resourceInfo = updateResourceInfo(mainJar);
|
||||
if (resourceInfo != null) {
|
||||
taskParameters.put("mainJar", resourceInfo);
|
||||
}
|
||||
taskParameters.put("mainJar", resourceInfo);
|
||||
}
|
||||
// update resourceList information
|
||||
if (taskParameters.containsKey("resourceList")) {
|
||||
|
|
@ -1810,6 +1808,10 @@ public class ProcessServiceImpl implements ProcessService {
|
|||
resourceInfo = new ResourceInfo();
|
||||
// get resource from database, only one resource should be returned
|
||||
Resource resource = getResourceById(resourceId);
|
||||
if (Objects.isNull(resource)) {
|
||||
logger.error("resource not found, resourceId: {}", resourceId);
|
||||
return null;
|
||||
}
|
||||
resourceInfo.setId(resourceId);
|
||||
resourceInfo.setRes(resource.getFileName());
|
||||
resourceInfo.setResourceName(resource.getFullName());
|
||||
|
|
|
|||
Loading…
Reference in New Issue