From 13c5cfa361c99e4019b20b170c61664f2db19b20 Mon Sep 17 00:00:00 2001 From: Bo Cui Date: Sat, 18 Jul 2020 10:26:00 +0800 Subject: [PATCH] HBASE-24570 connection#close throws NPE --- .../apache/hadoop/hbase/client/ConnectionImplementation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java index c88908fbb73..936f7f58327 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java @@ -2113,7 +2113,9 @@ class ConnectionImplementation implements ClusterConnection, Closeable { this.metrics.shutdown(); } this.closed = true; - registry.close(); + if (this.registry != null) { + registry.close(); + } this.stubs.clear(); if (clusterStatusListener != null) { clusterStatusListener.close();