You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by te...@apache.org on 2020/01/04 02:36:33 UTC

[incubator-dolphinscheduler] branch dev updated: fix sonar bug: change condition & not enough arguments (#1705)

This is an automated email from the ASF dual-hosted git repository.

technoboy pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 3593a60  fix sonar bug: change condition & not enough arguments (#1705)
3593a60 is described below

commit 3593a60374b89573f3ee67a54d878eb5984d199d
Author: Yelli <51...@users.noreply.github.com>
AuthorDate: Sat Jan 4 10:36:24 2020 +0800

    fix sonar bug: change condition & not enough arguments (#1705)
---
 .../src/main/java/org/apache/dolphinscheduler/dao/ProcessDao.java  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/ProcessDao.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/ProcessDao.java
index 95e18cc..ffb6feb 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/ProcessDao.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/ProcessDao.java
@@ -457,9 +457,12 @@ public class ProcessDao {
         if(tenantId >= 0){
             tenant = tenantMapper.queryById(tenantId);
         }
-        if(tenant == null){
+        if(null == tenant){
             User user = userMapper.selectById(userId);
-            tenant = tenantMapper.queryById(user.getTenantId());
+
+            if (null != user) {
+                tenant = tenantMapper.queryById(user.getTenantId());
+            }
         }
         return tenant;
     }