From 6cc0c86133666a249746a61cc6ce68d68a1e3fb7 Mon Sep 17 00:00:00 2001 From: Andrew Kyle Purtell Date: Wed, 22 Jan 2014 20:17:43 +0000 Subject: [PATCH] Amend HBASE-10338 Fix NPE if the server is terminated before the RegionServerCoprocessorHost is initialized (Vandana Ayyalasomayajula) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1560494 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/hadoop/hbase/regionserver/HRegionServer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 2144fbcc786..b74358e54f4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -1734,7 +1734,9 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa @Override public void stop(final String msg) { try { - this.rsHost.preStop(msg); + if (this.rsHost != null) { + this.rsHost.preStop(msg); + } this.stopped = true; LOG.info("STOPPED: " + msg); // Wakes run() if it is sleeping