You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2020/01/03 13:26:19 UTC

[GitHub] [incubator-dolphinscheduler] khadgarmage commented on a change in pull request #1684: fix get tenantCode my NPE

khadgarmage commented on a change in pull request #1684: fix get tenantCode my NPE
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1684#discussion_r362806265
 
 

 ##########
 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:
   Is necessary to putMsg and log error?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services