Skip to content
Snippets Groups Projects
Commit d124c70a authored by abat's avatar abat
Browse files

Merge into master from pull request #3307:

Fix NPE in deleteLinks() during keysModified() on Slave Node (https://github.com/bigswitch/bigswitchcontroller/pull/3307)
parents 21c8c6b4 7ba96eba
No related branches found
No related tags found
No related merge requests found
...@@ -1399,14 +1399,16 @@ public class LinkDiscoveryManager implements IOFMessageListener, ...@@ -1399,14 +1399,16 @@ public class LinkDiscoveryManager implements IOFMessageListener,
srcNpt = new NodePortTuple(lt.getSrc(), lt.getSrcPort()); srcNpt = new NodePortTuple(lt.getSrc(), lt.getSrcPort());
dstNpt = new NodePortTuple(lt.getDst(), lt.getDstPort()); dstNpt = new NodePortTuple(lt.getDst(), lt.getDstPort());
switchLinks.get(lt.getSrc()).remove(lt); if (switchLinks.containsKey(lt.getSrc())) {
switchLinks.get(lt.getDst()).remove(lt); switchLinks.get(lt.getSrc()).remove(lt);
if (switchLinks.containsKey(lt.getSrc()) if (switchLinks.get(lt.getSrc()).isEmpty())
&& switchLinks.get(lt.getSrc()).isEmpty()) this.switchLinks.remove(lt.getSrc());
this.switchLinks.remove(lt.getSrc()); }
if (this.switchLinks.containsKey(lt.getDst()) if (this.switchLinks.containsKey(lt.getDst())) {
&& this.switchLinks.get(lt.getDst()).isEmpty()) switchLinks.get(lt.getDst()).remove(lt);
this.switchLinks.remove(lt.getDst()); if (this.switchLinks.get(lt.getDst()).isEmpty())
this.switchLinks.remove(lt.getDst());
}
if (this.portLinks.get(srcNpt) != null) { if (this.portLinks.get(srcNpt) != null) {
this.portLinks.get(srcNpt).remove(lt); this.portLinks.get(srcNpt).remove(lt);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment