commit | 017960a5faf804210947b45d7076de24e4215a63 | [log] [tgz] |
---|---|---|
author | Pankaj Berde <pankaj@onlab.us> | Thu Mar 14 20:32:26 2013 -0700 |
committer | Pankaj Berde <pankaj@onlab.us> | Thu Mar 14 20:32:26 2013 -0700 |
tree | a41488e97b958c7be9b1b09c95ae2d5a7576ac99 | |
parent | 2ae3128b25ab1a592639b5101b161313facaf61d [diff] |
Null pointer exception for non-existent switch
diff --git a/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java b/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java index e727238..fe758cd 100644 --- a/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java +++ b/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java
@@ -281,7 +281,8 @@ String dpidStr = HexString.toHexString(dpid); - LeaderLatch latch = switches.get(dpidStr).getLatch(); + + LeaderLatch latch = (switches.get(dpidStr) != null)?switches.get(dpidStr).getLatch():null; if (latch == null){ log.warn("Tried to get controller for non-existent switch");