aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukasz Muszkieta <lukasz.muszkieta@nokia.com>2019-09-30 12:33:30 +0000
committerGerrit Code Review <gerrit@onap.org>2019-09-30 12:33:30 +0000
commit3b007e23e4acca0405db0fd18f05195d49c4f988 (patch)
treed09505da5fd465669d20b0fbb6ace6046f074dd1
parentd6a26f001eb691c6e8b7269e9045980ca3a57e9b (diff)
parent45fd1ff76bfb9284136cf38734e6369a0d47a6e0 (diff)
Merge "Added null check for vMap to prevent static analyzer warning about potential crash at vMap.entrySet() call"
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java14
1 files changed, 8 insertions, 6 deletions
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 d33e7aed0c..70365b744c 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 @@ public class WorkflowProcessor extends ProcessEngineAwareService {
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;
}