Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B5084200D28 for ; Sun, 8 Oct 2017 17:04:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B3B161609CB; Sun, 8 Oct 2017 15:04:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0580D1609E6 for ; Sun, 8 Oct 2017 17:04:15 +0200 (CEST) Received: (qmail 29059 invoked by uid 500); 8 Oct 2017 15:04:15 -0000 Mailing-List: contact commits-help@kylin.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kylin.apache.org Delivered-To: mailing list commits@kylin.apache.org Received: (qmail 29042 invoked by uid 99); 8 Oct 2017 15:04:15 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Oct 2017 15:04:15 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 15CE3F5B2D; Sun, 8 Oct 2017 15:04:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: liyang@apache.org To: commits@kylin.apache.org Date: Sun, 08 Oct 2017 15:04:16 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [02/11] kylin git commit: minor, fix NPE in ACL ValidateUtil getALlUsers archived-at: Sun, 08 Oct 2017 15:04:16 -0000 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 Authored: Sat Sep 30 15:04:19 2017 +0800 Committer: Li Yang 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; }