diff options
author | YuanHu <yuan.hu1@zte.com.cn> | 2018-03-07 17:13:17 +0800 |
---|---|---|
committer | YuanHu <yuan.hu1@zte.com.cn> | 2018-03-08 09:13:47 +0800 |
commit | 548e5f5ed2ad5a7c8ac29a6f5245c4779bb28f11 (patch) | |
tree | 53a86a7e1c0f591386dd5eaaaddd0047d6d023de /sdc-workflow-designer-server | |
parent | 949ea6b27ad7912fa8476a6c817f61d821a05ff7 (diff) |
Fixed the bugs checked by sonar.
Add null pointer detected and protected.
Issue-ID: SDC-1079
Change-Id: I39c5280746d8ca2b476cbe27520d34370cb9075b
Signed-off-by: YuanHu <yuan.hu1@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-server')
-rw-r--r-- | sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java index 1b3a8779..d214b389 100644 --- a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java @@ -158,6 +158,11 @@ public class Bpmn4ToscaJsonParser { Element element;
String nodeType = getValueFromJsonNode(jsonNode, JsonKeys.TYPE);
+ if (nodeType == null) {
+ log.warn("Ignoring node: type is null");
+ return null;
+ }
+
switch (nodeType) {
case "startEvent":
element = MAPPER.readValue(jsonObject, StartEvent.class);
|