Merge "Added null check for execute() result to remove static analyzer warning"
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
index 137aaa9..d8a8760 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
@@ -84,11 +84,13 @@
         relationships.add(vfModuleRelationship);
 
         // vserver to image relationship
-        Relationship imageRel = buildRelationship(HeatBridgeConstants.AAI_IMAGE,
-                ImmutableMap.<String, String>builder().put(HeatBridgeConstants.AAI_CLOUD_OWNER, cloudOwner)
-                        .put(HeatBridgeConstants.AAI_CLOUD_REGION_ID, cloudRegionId)
-                        .put(HeatBridgeConstants.AAI_IMAGE_ID, server.getImage().getId()).build());
-        relationships.add(imageRel);
+        if (server.getImage() != null) {
+            Relationship imageRel = buildRelationship(HeatBridgeConstants.AAI_IMAGE,
+                    ImmutableMap.<String, String>builder().put(HeatBridgeConstants.AAI_CLOUD_OWNER, cloudOwner)
+                            .put(HeatBridgeConstants.AAI_CLOUD_REGION_ID, cloudRegionId)
+                            .put(HeatBridgeConstants.AAI_IMAGE_ID, server.getImage().getId()).build());
+            relationships.add(imageRel);
+        }
 
         // vserver to flavor relationship
         Relationship flavorRel = buildRelationship(HeatBridgeConstants.AAI_FLAVOR,
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
index 3cf5a60..433aa0c 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
@@ -389,11 +389,8 @@
             String instanceName, ConfigurationResourceKeys configurationResourceKeys, RequestDetails requestDetails) {
         Configuration configuration = null;
         for (Configuration configurationTemp : serviceInstance.getConfigurations()) {
-            if ((bbName.contains("Fabric") && configurationTemp.getConfigurationSubType() != null
-                    && configurationTemp.getConfigurationSubType().equalsIgnoreCase("Fabric Config"))
-                    || (lookupKeyMap.get(ResourceKey.CONFIGURATION_ID) != null && configurationTemp.getConfigurationId()
-                            .equalsIgnoreCase(lookupKeyMap.get(ResourceKey.CONFIGURATION_ID)))) {
-                lookupKeyMap.put(ResourceKey.CONFIGURATION_ID, configurationTemp.getConfigurationId());
+            if (lookupKeyMap.get(ResourceKey.CONFIGURATION_ID) != null && configurationTemp.getConfigurationId()
+                    .equalsIgnoreCase(lookupKeyMap.get(ResourceKey.CONFIGURATION_ID))) {
                 configuration = configurationTemp;
                 org.onap.aai.domain.yang.Configuration aaiConfiguration =
                         bbInputSetupUtils.getAAIConfiguration(configuration.getConfigurationId());
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
index d33e7ae..70365b7 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
@@ -85,12 +85,14 @@
         Map<String, Object> inputVariables = new HashMap<>();
         @SuppressWarnings("unchecked")
         Map<String, Object> vMap = (Map<String, Object>) variableMap.get("variables");
-        for (Map.Entry<String, Object> entry : vMap.entrySet()) {
-            String vName = entry.getKey();
-            Object value = entry.getValue();
-            @SuppressWarnings("unchecked")
-            Map<String, Object> valueMap = (Map<String, Object>) value; // value, type
-            inputVariables.put(vName, valueMap.get("value"));
+        if (vMap != null) {
+            for (Map.Entry<String, Object> entry : vMap.entrySet()) {
+                String vName = entry.getKey();
+                Object value = entry.getValue();
+                @SuppressWarnings("unchecked")
+                Map<String, Object> valueMap = (Map<String, Object>) value; // value, type
+                inputVariables.put(vName, valueMap.get("value"));
+            }
         }
         return inputVariables;
     }