summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main/java/org
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2019-05-06 11:44:35 +0000
committerGerrit Code Review <gerrit@onap.org>2019-05-06 11:44:35 +0000
commit8668df008ae252d0e43d23ef00c8e350bdb0900b (patch)
tree15312d11cdc20fd416b60b65ece6e2e06ad1ca73 /bpmn/MSOCommonBPMN/src/main/java/org
parentb5e31aaea92e3204d0257608f96eb1a182bcb37f (diff)
parent8202525d2e4ede3754b1b48c560bce8493aff281 (diff)
Merge "Fixed NPE in ResourceRequestBuilder"
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java/org')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
index 58f775ce0b..0df25be714 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
@@ -151,7 +151,7 @@ public class ResourceRequestBuilder {
Map<String, String> resourceInputData = getResourceInputStr(serviceVnfCust, resourceCustomizationUuid);
// find match in network resource
- if (resourceInputData.size() == 0) {
+ if (resourceInputData != null && resourceInputData.isEmpty()) {
List<Map<String, Object>> serviceNetworkCust =
(List<Map<String, Object>>) serviceResources.get("serviceNetworks");
resourceInputData = getResourceInputStr(serviceNetworkCust, resourceCustomizationUuid);
@@ -164,15 +164,19 @@ public class ResourceRequestBuilder {
}
}
- String resourceInputStr = resourceInputData.get("resourceInput");
- ResourceLevel resourceLevel = ResourceLevel.valueOf(resourceInputData.get("nodeType"));
+ String resourceInputStr = null;
+ ResourceLevel resourceLevel = null;
+ if (resourceInputData != null) {
+ resourceInputStr = resourceInputData.get("resourceInput");
+ resourceLevel = ResourceLevel.valueOf(resourceInputData.get("nodeType"));
+ }
- if (resourceInputStr != null && !resourceInputStr.isEmpty()) {
+ if (resourceInputStr != null && !resourceInputStr.isEmpty() && resourceLevel != null) {
return getResourceInput(resourceInputStr, serviceInputs, resourceLevel, currentVFData);
}
} catch (Exception e) {
- logger.error("not able to retrieve service instance");
+ logger.error("not able to retrieve service instance", e);
}
return new HashMap();
}