Repository: sentry
Updated Branches:
  refs/heads/sentry-ha-redesign 2a4d9c50f -> fd16d74ab


SENTRY-1658: Null pointer dereference in SentryShellHive (Jan Hentschel, 
Reviewed by: Alexander Kolbasov and Hao Hao)

Change-Id: Ie929463f6edec99720a0b62dbb855998288189b2


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

Branch: refs/heads/sentry-ha-redesign
Commit: fd16d74abcd602b758ef06fea44248ffa4665924
Parents: 2a4d9c5
Author: hahao <[email protected]>
Authored: Wed Mar 15 16:38:58 2017 -0700
Committer: hahao <[email protected]>
Committed: Wed Mar 15 16:40:56 2017 -0700

----------------------------------------------------------------------
 .../org/apache/sentry/provider/db/tools/SentryShellHive.java  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/fd16d74a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentryShellHive.java
----------------------------------------------------------------------
diff --git 
a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentryShellHive.java
 
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentryShellHive.java
index dc7f829..1d09846 100644
--- 
a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentryShellHive.java
+++ 
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/tools/SentryShellHive.java
@@ -90,8 +90,11 @@ public class SentryShellHive extends SentryShellCommon {
       while (current != null && current.getMessage() == null) {
         current = current.getCause();
       }
-       System.out.println("The operation failed." +
-          (current.getMessage() == null ? "" : "  Message: " + 
current.getMessage()));
+
+      if (current != null) {
+        System.out.println("The operation failed." +
+           (current.getMessage() == null ? "" : "  Message: " + 
current.getMessage()));
+      }
     }
   }
 

Reply via email to