From: Yevgeny Khodorkovsky Date: Mon, 7 Oct 2013 17:25:56 +0000 (-0700) Subject: Fix NPE in OF plugin Topology Service shim X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-1~658 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F30%2F1730%2F2;hp=39a011908c0ef7a325d6aabf885e1eca98921053;p=controller.git Fix NPE in OF plugin Topology Service shim This fixes a NPE that occurs in cluster mode with multiple containers Change-Id: Ic852cb41f6f65ef5812f9d3f1729434533ce0f5a Signed-off-by: Yevgeny Khodorkovsky --- diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/TopologyServiceShim.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/TopologyServiceShim.java index 86583ace0a..bb5681b2df 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/TopologyServiceShim.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/TopologyServiceShim.java @@ -131,8 +131,11 @@ public class TopologyServiceShim implements IDiscoveryListener, if (notifyListeners) { for (String container : teuMap.keySet()) { // notify the listener - topologyServiceShimListeners.get(container) - .edgeUpdate(teuMap.get(container)); + ITopologyServiceShimListener l = topologyServiceShimListeners.get(container); + // container topology service may not have come up yet + if (l != null) { + l.edgeUpdate(teuMap.get(container)); + } } }