Don't NPE when shutting down non-existent thrift server

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

Branch: refs/heads/cassandra-1.2
Commit: 9eddaa8ffa212c42f32f7d1e8b485d5aa0e2f10f
Parents: c040759
Author: Brandon Williams <[email protected]>
Authored: Thu Oct 24 09:56:38 2013 -0500
Committer: Brandon Williams <[email protected]>
Committed: Thu Oct 24 09:56:38 2013 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/service/StorageService.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9eddaa8f/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index bde54a7..96c2dd9 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -318,7 +318,8 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
         {
             throw new IllegalStateException("No configured daemon");
         }
-        daemon.thriftServer.stop();
+        if (daemon.thriftServer != null)
+            daemon.thriftServer.stop();
     }
 
     public boolean isRPCServerRunning()

Reply via email to