From a102aedad78cd54bba3e7c92b0c1bbefd0508044 Mon Sep 17 00:00:00 2001 From: "Kuleshov, Elena" Date: Tue, 25 Aug 2020 10:05:34 -0400 Subject: Additional null checks while building vserver Additional null checks while building vserver interfaces. Issue-ID: SO-3197 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I9835535e6b13ee434a1532e1a739184b56bbc011 --- .../src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'adapters/mso-openstack-adapters') 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 ef2577d6fe..45d91c26c4 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 @@ -303,6 +303,8 @@ public class HeatBridgeImpl implements HeatBridgeApi { Objects.requireNonNull(osClient, ERR_MSG_NULL_OS_CLIENT); List portIds = extractStackResourceIdsByResourceType(stackResources, HeatBridgeConstants.OS_PORT_RESOURCE_TYPE); + if (portIds == null) + return; for (String portId : portIds) { Port port = osClient.getPortById(portId); Network network = osClient.getNetworkById(port.getNetworkId()); @@ -320,7 +322,7 @@ public class HeatBridgeImpl implements HeatBridgeApi { lIf.setInterfaceRole(port.getvNicType()); } boolean isL2Multicast = false; - if (port.getProfile().get("trusted") != null) { + if (port.getProfile() != null && port.getProfile().get("trusted") != null) { String trusted = port.getProfile().get("trusted").toString(); if (Boolean.parseBoolean(trusted)) { isL2Multicast = true; -- cgit 1.2.3-korg