diff options
author | Lukasz Muszkieta <lukasz.muszkieta@nokia.com> | 2019-09-30 12:33:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-09-30 12:33:30 +0000 |
commit | 3b007e23e4acca0405db0fd18f05195d49c4f988 (patch) | |
tree | d09505da5fd465669d20b0fbb6ace6046f074dd1 /bpmn | |
parent | d6a26f001eb691c6e8b7269e9045980ca3a57e9b (diff) | |
parent | 45fd1ff76bfb9284136cf38734e6369a0d47a6e0 (diff) |
Merge "Added null check for vMap to prevent static analyzer warning about potential crash at vMap.entrySet() call"
Diffstat (limited to 'bpmn')
-rw-r--r-- | bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java | 14 |
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; } |