commit | aaa4f83286d5d77824510406d899f61709c06401 | [log] [tgz] |
---|---|---|
author | jaegonkim <jaegon77.kim@samsung.com> | Sun Mar 11 00:48:36 2018 +0900 |
committer | Ray Milkey <ray@opennetworking.org> | Tue Mar 13 04:37:38 2018 +0000 |
tree | fe2078e4c4e57038e0949481aec95c75b6661733 | |
parent | 6fb95fccf8356a7549fbb4d0fd638d7537982c7d [diff] |
[ONOS-7518] NullPointerException in LinkDiscovery Change-Id: I131819c2f761d231d185d211c9e369de80972ad1
diff --git a/providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java b/providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java index ec2c1f4..3631e16 100644 --- a/providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java +++ b/providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java
@@ -21,6 +21,7 @@ import io.netty.util.Timeout; import io.netty.util.TimerTask; +import io.netty.util.internal.StringUtil; import org.onlab.packet.Ethernet; import org.onlab.packet.MacAddress; import org.onlab.packet.ONOSLLDP; @@ -132,6 +133,9 @@ public void addPort(Port port) { Long portNum = port.number().toLong(); String portName = port.annotations().value(PORT_NAME); + if (portName == null) { + portName = StringUtil.EMPTY_STRING; + } boolean newPort = !containsPort(portNum); portMap.put(portNum, portName);