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 9145c55c0a4..cfbc19cc30f 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 @@ -2116,7 +2116,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();