samz406 commented on a change in pull request #1684: fix get tenantCode my NPE
URL:
https://github.com/apache/incubator-dolphinscheduler/pull/1684#discussion_r363013907
##########
File path:
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java
##########
@@ -522,8 +529,11 @@ public Result readResource(int resourceId, int
skipLineNum, int limit) {
}
}
- User user = userMapper.queryDetailsById(resource.getUserId());
- String tenantCode =
tenantMapper.queryById(user.getTenantId()).getTenantCode();
+ String tenantCode = getTenantCode(resource.getUserId(),result);
+ if (StringUtils.isEmpty(tenantCode)){
+ return result;
Review comment:
add error log in getTenantCode method
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services