commit | 3a14059b1bcd75068661efeec5f414ca34b68b63 | [log] [tgz] |
---|---|---|
author | Daniel Park <dan.mcpark84@gmail.com> | Thu Jun 28 18:33:10 2018 +0900 |
committer | Jian Li <pyguni@gmail.com> | Mon Jul 02 05:30:29 2018 +0000 |
tree | 50946ce68770d37ecc02fe400bfc73c71726c4ff | |
parent | 998ec7b4833ed40e6c525307886bb20d6640c9f1 [diff] |
Fixes to avoid NPE of OpenstackSecurityGroupHandler in case OpenstackNetworking app is modified Change-Id: I52e8e944732e0099743f9bf3d1d097fe40da1d9f
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSecurityGroupHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSecurityGroupHandler.java index 387fdad..7fa85a9 100644 --- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSecurityGroupHandler.java +++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSecurityGroupHandler.java
@@ -248,6 +248,10 @@ private void updateSecurityGroupRule(InstancePort instPort, Port port, SecurityGroupRule sgRule, boolean install) { + if (instPort == null || port == null || sgRule == null) { + return; + } + if (sgRule.getRemoteGroupId() != null && !sgRule.getRemoteGroupId().isEmpty()) { getRemoteInstPorts(port.getTenantId(), sgRule.getRemoteGroupId()) .forEach(rInstPort -> {