Bug 8838 - aclservice NPE's 01/60301/2
authorAswin Suryanarayanan <asuryana@redhat.com>
Thu, 13 Jul 2017 18:17:13 +0000 (23:47 +0530)
committerSam Hague <shague@redhat.com>
Fri, 14 Jul 2017 19:21:32 +0000 (19:21 +0000)
Ignoring notification for ports which are not present in AclInterface
cache.

Change-Id: I8492eb356482d0d84afe5843db74c9e0ac1496b7
Signed-off-by: Aswin Suryanarayanan <asuryana@redhat.com>
vpnservice/aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/listeners/AclVpnChangeListener.java

index 2d9c3f74fa94f5c8544142116d8d3eae614761a0..98def28831fd9d2179dd910f6c6172c713ac89b9 100644 (file)
@@ -60,7 +60,7 @@ public class AclVpnChangeListener implements OdlL3vpnListener {
         LOG.trace("Processing vpn interface {} addition", data.getInterfaceName());
         Long vpnId = data.getVpnId();
         AclInterface aclInterface = AclInterfaceCacheUtil.getAclInterfaceFromCache(data.getInterfaceName());
-        if (!vpnId.equals(aclInterface.getVpnId())) {
+        if (null != aclInterface && !vpnId.equals(aclInterface.getVpnId())) {
             aclServiceManager.notify(aclInterface, null, Action.UNBIND);
             aclInterface.setVpnId(vpnId);
             aclServiceManager.notify(aclInterface, null, Action.BIND);
@@ -73,7 +73,7 @@ public class AclVpnChangeListener implements OdlL3vpnListener {
         LOG.trace("Processing vpn interface {} deletion", data.getInterfaceName());
         Long vpnId = data.getVpnId();
         AclInterface aclInterface = AclInterfaceCacheUtil.getAclInterfaceFromCache(data.getInterfaceName());
-        if (vpnId.equals(aclInterface.getVpnId())) {
+        if (null != aclInterface && vpnId.equals(aclInterface.getVpnId())) {
             aclServiceManager.notify(aclInterface, null, Action.UNBIND);
             aclInterface.setVpnId(null);
             aclServiceManager.notify(aclInterface, null, Action.BIND);