diff options
author | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2020-05-26 10:02:57 +0200 |
---|---|---|
committer | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2020-05-26 10:37:21 +0200 |
commit | 7c35f6dd4fd4b227f063036280a7f24728a198d8 (patch) | |
tree | 2f9fc20057c5000f4a168cbf4c9a4dd8a17d68a3 | |
parent | 88484fe25b16721ab3158ad8edf3168462b41c3f (diff) |
Fix for NPE in Heatbridge
Null is checked for network type which can
be unknown.
Issue-ID: SO-2953
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
Change-Id: Iccf724eed5ec7d69b70eabbcf25bfafe1e8fe12b
-rw-r--r-- | adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java index e83ec8387a..5a33dad2a6 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java @@ -325,7 +325,7 @@ public class HeatBridgeImpl implements HeatBridgeApi { Vlan vlan = new Vlan(); Network network = osClient.getNetworkById(port.getNetworkId()); lIf.setNetworkName(network.getName()); - if (network.getNetworkType().equals(NetworkType.VLAN)) { + if (network.getNetworkType() != null && network.getNetworkType().equals(NetworkType.VLAN)) { vlan.setVlanInterface(network.getProviderSegID()); Vlans vlans = new Vlans(); List<Vlan> vlanList = vlans.getVlan(); @@ -333,7 +333,7 @@ public class HeatBridgeImpl implements HeatBridgeApi { lIf.setVlans(vlans); } // Build sriov-vf to the l-interface - if (port.getvNicType().equalsIgnoreCase(HeatBridgeConstants.OS_SRIOV_PORT_TYPE)) { + if (port.getvNicType() != null && port.getvNicType().equalsIgnoreCase(HeatBridgeConstants.OS_SRIOV_PORT_TYPE)) { SriovVfs sriovVfs = new SriovVfs(); // JAXB does not generate setters for list, however getter ensures its creation. // Thus, all list manipulations must be made on live list. |