kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [02/11] kylin git commit: minor, fix NPE in ACL ValidateUtil getALlUsers
Date Sun, 08 Oct 2017 15:04:16 GMT
minor, fix NPE in ACL ValidateUtil getALlUsers


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2415fd9e
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2415fd9e
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2415fd9e

Branch: refs/heads/master
Commit: 2415fd9e65b7bf483c375eda7d074c6804edb60e
Parents: bd7cb9c
Author: Billy Liu <billyliu@apache.org>
Authored: Sat Sep 30 15:04:19 2017 +0800
Committer: Li Yang <liyang@apache.org>
Committed: Sat Sep 30 16:11:29 2017 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/kylin/rest/util/ValidateUtil.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/2415fd9e/server-base/src/main/java/org/apache/kylin/rest/util/ValidateUtil.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/util/ValidateUtil.java b/server-base/src/main/java/org/apache/kylin/rest/util/ValidateUtil.java
index abb326f..7e513ae 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/util/ValidateUtil.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/util/ValidateUtil.java
@@ -122,8 +122,10 @@ public class ValidateUtil {
         ProjectInstance prj = projectService.getProjectManager().getProject(project);
         AclEntity ae = accessService.getAclEntity("ProjectInstance", prj.getUuid());
         Acl acl = accessService.getAcl(ae);
-        for (AccessControlEntry ace : acl.getEntries()) {
-            allUsers.add(((PrincipalSid) ace.getSid()).getPrincipal());
+        if (acl != null && acl.getEntries() != null) {
+            for (AccessControlEntry ace : acl.getEntries()) {
+                allUsers.add(((PrincipalSid) ace.getSid()).getPrincipal());
+            }
         }
         return allUsers;
     }


Mime
View raw message