kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kangkai...@apache.org
Subject [18/50] [abbrv] kylin git commit: minor, fix ACL NPE
Date Fri, 07 Jul 2017 08:38:20 GMT
minor, fix ACL NPE


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

Branch: refs/heads/KYLIN-2606
Commit: 052d6096779d5826ba24517b0b4cc9a45b78bf4a
Parents: 8ca0d32
Author: Roger Shi <rogershijicheng@hotmail.com>
Authored: Thu Jun 29 17:23:13 2017 +0800
Committer: liyang-gmt8 <liyang@apache.org>
Committed: Thu Jun 29 18:24:43 2017 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/kylin/rest/service/AccessService.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/052d6096/server-base/src/main/java/org/apache/kylin/rest/service/AccessService.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/AccessService.java b/server-base/src/main/java/org/apache/kylin/rest/service/AccessService.java
index affa508..ae7ac6e 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/service/AccessService.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/service/AccessService.java
@@ -19,6 +19,7 @@
 package org.apache.kylin.rest.service;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.kylin.common.persistence.AclEntity;
@@ -297,8 +298,11 @@ public class AccessService {
     }
 
     public List<AccessEntryResponse> generateAceResponses(Acl acl) {
-        List<AccessEntryResponse> result = new ArrayList<AccessEntryResponse>();
+        if (null == acl) {
+            return Collections.emptyList();
+        }
 
+        List<AccessEntryResponse> result = new ArrayList<AccessEntryResponse>();
         for (AccessControlEntry ace : acl.getEntries()) {
             result.add(new AccessEntryResponse(ace.getId(), ace.getSid(), ace.getPermission(),
ace.isGranting()));
         }


Mime
View raw message