Charles Chan
Committed by Gerrit Code Review

Fix NPE when ControlPlaneConnectPoint config is added after interface config

Change-Id: I31ee1d2e646d4b4c88ac5bb3b661228c893292b9
......@@ -597,12 +597,15 @@ public class ControlPlaneRedirectManager {
}
private class InternalInterfaceListener implements InterfaceListener {
@Override
public void event(InterfaceEvent event) {
Interface intf = event.subject();
Interface prevIntf = event.prevSubject();
switch (event.type()) {
if (controlPlaneConnectPoint == null) {
log.info("Control plane connect point is not configured. Abort InterfaceEvent.");
return;
}
Interface intf = event.subject();
Interface prevIntf = event.prevSubject();
switch (event.type()) {
case INTERFACE_ADDED:
if (intf != null && !intf.connectPoint().equals(controlPlaneConnectPoint)) {
provisionInterface(intf);
......@@ -620,7 +623,7 @@ public class ControlPlaneRedirectManager {
break;
default:
break;
}
}
}
}
}
......