From 45fd1ff76bfb9284136cf38734e6369a0d47a6e0 Mon Sep 17 00:00:00 2001 From: Oleksandr Moliavko Date: Thu, 26 Sep 2019 15:10:51 +0300 Subject: Added null check for vMap to prevent static analyzer warning about potential crash at vMap.entrySet() call Issue-ID: SO-1841 Signed-off-by: Oleksandr Moliavko Change-Id: I6eacb28c6720b7432fd31faabacd9dc52f0abe60 --- .../so/bpmn/common/workflow/service/WorkflowProcessor.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'bpmn') 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 inputVariables = new HashMap<>(); @SuppressWarnings("unchecked") Map vMap = (Map) variableMap.get("variables"); - for (Map.Entry entry : vMap.entrySet()) { - String vName = entry.getKey(); - Object value = entry.getValue(); - @SuppressWarnings("unchecked") - Map valueMap = (Map) value; // value, type - inputVariables.put(vName, valueMap.get("value")); + if (vMap != null) { + for (Map.Entry entry : vMap.entrySet()) { + String vName = entry.getKey(); + Object value = entry.getValue(); + @SuppressWarnings("unchecked") + Map valueMap = (Map) value; // value, type + inputVariables.put(vName, valueMap.get("value")); + } } return inputVariables; } -- cgit 1.2.3-korg