From 6bcccde06ad58f6c8d2a9a09a3c80a8642db73eb Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 11 Sep 2013 15:26:53 +0000 Subject: [PATCH] HBASE-9498 NPE in HBaseAdmin if master not running git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1521902 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/hadoop/hbase/client/HBaseAdmin.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 38bd63c7998..e368ca27043 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -3062,7 +3062,8 @@ public class HBaseAdmin implements Abortable, Closeable { @Override public void close() throws IOException { - this.masterAdmin.close(); + // The above prepare could fail but this would still be called though masterAdmin is null + if (this.masterAdmin != null) this.masterAdmin.close(); } } @@ -3083,7 +3084,8 @@ public class HBaseAdmin implements Abortable, Closeable { @Override public void close() throws IOException { - this.masterMonitor.close(); + // The above prepare could fail but this would still be called though masterMonitor is null + if (this.masterMonitor != null) this.masterMonitor.close(); } }