From 30b143b7cbaf3ec7a843bf1ff52b298eb4550be6 Mon Sep 17 00:00:00 2001 From: "Smokowski, Steven" Date: Tue, 2 Jun 2020 14:34:36 -0400 Subject: Add null check for network name Add null check for network name Issue-ID: SO-2971 Signed-off-by: Benjamin, Max (mb388a) Change-Id: Ifb3fe5f7b85157ddb29efec385b7a77ab3701249 --- .../src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to '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 bbabd7fab8..32cd92d70e 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 @@ -59,7 +59,6 @@ import org.onap.aai.domain.yang.VfModule; import org.onap.aai.domain.yang.Vlan; import org.onap.aai.domain.yang.Vlans; import org.onap.aai.domain.yang.Vserver; -import org.onap.logging.filter.base.ErrorCode; import org.onap.aaiclient.client.aai.AAIObjectType; import org.onap.aaiclient.client.aai.AAIResourcesClient; import org.onap.aaiclient.client.aai.AAISingleTransactionClient; @@ -69,6 +68,7 @@ import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; import org.onap.aaiclient.client.graphinventory.entities.uri.Depth; import org.onap.aaiclient.client.graphinventory.exceptions.BulkProcessFailed; +import org.onap.logging.filter.base.ErrorCode; import org.onap.so.db.catalog.beans.CloudIdentity; import org.onap.so.db.catalog.beans.ServerType; import org.onap.so.heatbridge.constants.HeatBridgeConstants; @@ -263,7 +263,9 @@ public class HeatBridgeImpl implements HeatBridgeApi { lIf.setInterfaceId(port.getId()); lIf.setInterfaceName(port.getName()); lIf.setMacaddr(port.getMacAddress()); - lIf.setNetworkName((String) port.getProfile().get("physical_network")); + if (port.getProfile() != null && port.getProfile().get("physical_network") != null) { + lIf.setNetworkName((String) port.getProfile().get("physical_network")); + } lIf.setIsPortMirrored(false); lIf.setIsIpUnnumbered(false); lIf.setInMaint(false); -- cgit 1.2.3-korg