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
... | @@ -609,12 +609,15 @@ public class ControlPlaneRedirectManager { | ... | @@ -609,12 +609,15 @@ public class ControlPlaneRedirectManager { |
609 | } | 609 | } |
610 | 610 | ||
611 | private class InternalInterfaceListener implements InterfaceListener { | 611 | private class InternalInterfaceListener implements InterfaceListener { |
612 | - | ||
613 | @Override | 612 | @Override |
614 | public void event(InterfaceEvent event) { | 613 | public void event(InterfaceEvent event) { |
615 | - Interface intf = event.subject(); | 614 | + if (controlPlaneConnectPoint == null) { |
616 | - Interface prevIntf = event.prevSubject(); | 615 | + log.info("Control plane connect point is not configured. Abort InterfaceEvent."); |
617 | - switch (event.type()) { | 616 | + return; |
617 | + } | ||
618 | + Interface intf = event.subject(); | ||
619 | + Interface prevIntf = event.prevSubject(); | ||
620 | + switch (event.type()) { | ||
618 | case INTERFACE_ADDED: | 621 | case INTERFACE_ADDED: |
619 | if (intf != null && !intf.connectPoint().equals(controlPlaneConnectPoint)) { | 622 | if (intf != null && !intf.connectPoint().equals(controlPlaneConnectPoint)) { |
620 | provisionInterface(intf, true); | 623 | provisionInterface(intf, true); |
... | @@ -632,7 +635,7 @@ public class ControlPlaneRedirectManager { | ... | @@ -632,7 +635,7 @@ public class ControlPlaneRedirectManager { |
632 | break; | 635 | break; |
633 | default: | 636 | default: |
634 | break; | 637 | break; |
635 | - } | 638 | + } |
636 | } | 639 | } |
637 | } | 640 | } |
638 | } | 641 | } | ... | ... |
-
Please register or login to post a comment