argument should be checked for null before dereferencing

Change-Id: I3f13d924727a0e522f149d0e1842a730fe7d0e14
This commit is contained in:
Palash Kala 2017-03-30 16:42:23 +09:00
parent 9bf01a1d39
commit a8e1bfa725

View File

@ -62,6 +62,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.StringTokenizer;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.slf4j.LoggerFactory.getLogger;
/**
@ -151,6 +152,7 @@ public class IsisTopologyProvider extends AbstractProvider implements DeviceProv
* @return link description
*/
private LinkDescription buildLinkDes(IsisLink isisLink) {
checkNotNull(isisLink);
long srcAddress = 0;
long dstAddress = 0;
boolean localPseduo = false;
@ -185,9 +187,8 @@ public class IsisTopologyProvider extends AbstractProvider implements DeviceProv
ConnectPoint src = new ConnectPoint(srcId, PortNumber.portNumber(srcAddress));
ConnectPoint dst = new ConnectPoint(dstId, PortNumber.portNumber(dstAddress));
DefaultAnnotations.Builder annotationBuilder = DefaultAnnotations.builder();
if (isisLink != null) {
annotationBuilder = buildAnnotations(annotationBuilder, isisLink);
}
return new DefaultLinkDescription(src, dst, Link.Type.DIRECT, false, annotationBuilder.build());
}