getZooKeeper() should fail if the instance has been closed CURATOR-100
authorrandgalt <randgalt@apache.org>
Thu, 3 Apr 2014 15:10:21 +0000 (10:10 -0500)
committerrandgalt <randgalt@apache.org>
Thu, 3 Apr 2014 15:10:21 +0000 (10:10 -0500)
curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java

index f0a4ab3..f14214f 100644 (file)
@@ -110,6 +110,8 @@ public class CuratorZookeeperClient implements Closeable
      */
     public ZooKeeper getZooKeeper() throws Exception
     {
+        Preconditions.checkState(started.get(), "Client is not started");
+
         return state.getZooKeeper();
     }