Updated demo scripts: the demo now outputs per-protocol information.
[affinity.git] / l2agent / src / main / java / org / opendaylight / affinity / l2agent / L2Agent.java
index f25dc71b2aa2bebd6edf89bccaee8d8a2bc5a6fd..c8d1e3aa43dc54926027435bea244bb28bc0d3bd 100644 (file)
@@ -211,7 +211,9 @@ public class L2Agent implements IListenDataPacket, IfL2Agent {
     @Override
     public NodeConnector lookup_output_port(Node node, byte [] dstMAC) {
         long dstMAC_val = BitBufferHelper.toNumber(dstMAC);
-        NodeConnector nc = this.mac_to_ports.get(node).get(dstMAC_val);
+        NodeConnector nc = null;
+        if (this.mac_to_ports.get(node) != null)
+            nc = this.mac_to_ports.get(node).get(dstMAC_val);
         logger.debug("lookup_output_port: Node = {}, dst mac = {}, Nodeconnector = {}", node, dstMAC, nc);
         return nc;
     }