Committed by
Gerrit Code Review
Fix NPE when ControlPlaneConnectPoint config is added after interface config
Change-Id: I31ee1d2e646d4b4c88ac5bb3b661228c893292b9
Showing
1 changed file
with
8 additions
and
5 deletions
... | @@ -597,12 +597,15 @@ public class ControlPlaneRedirectManager { | ... | @@ -597,12 +597,15 @@ public class ControlPlaneRedirectManager { |
597 | } | 597 | } |
598 | 598 | ||
599 | private class InternalInterfaceListener implements InterfaceListener { | 599 | private class InternalInterfaceListener implements InterfaceListener { |
600 | - | ||
601 | @Override | 600 | @Override |
602 | public void event(InterfaceEvent event) { | 601 | public void event(InterfaceEvent event) { |
603 | - Interface intf = event.subject(); | 602 | + if (controlPlaneConnectPoint == null) { |
604 | - Interface prevIntf = event.prevSubject(); | 603 | + log.info("Control plane connect point is not configured. Abort InterfaceEvent."); |
605 | - switch (event.type()) { | 604 | + return; |
605 | + } | ||
606 | + Interface intf = event.subject(); | ||
607 | + Interface prevIntf = event.prevSubject(); | ||
608 | + switch (event.type()) { | ||
606 | case INTERFACE_ADDED: | 609 | case INTERFACE_ADDED: |
607 | if (intf != null && !intf.connectPoint().equals(controlPlaneConnectPoint)) { | 610 | if (intf != null && !intf.connectPoint().equals(controlPlaneConnectPoint)) { |
608 | provisionInterface(intf); | 611 | provisionInterface(intf); |
... | @@ -620,7 +623,7 @@ public class ControlPlaneRedirectManager { | ... | @@ -620,7 +623,7 @@ public class ControlPlaneRedirectManager { |
620 | break; | 623 | break; |
621 | default: | 624 | default: |
622 | break; | 625 | break; |
623 | - } | 626 | + } |
624 | } | 627 | } |
625 | } | 628 | } |
626 | } | 629 | } | ... | ... |
-
Please register or login to post a comment