From: shashikanth Date: Fri, 22 Sep 2017 11:22:23 +0000 (+0530) Subject: Fix Blocker/Critical sonar issues X-Git-Tag: v1.1.0~12 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=0e6adf5e9464573b814f85e8192972483678d3ee;p=aai%2Fresources.git Fix Blocker/Critical sonar issues Fix Blocker/Critical sonar issues in aai/resources module https://sonar.onap.org/component_issues?id=org.onap.aai.resources%3Aresources#resolved=false|severities=BLOCKER Issue fixed: NullPointerException might be thrown as 'actionElement' is nullable here Issue-Id:AAI-247 Change-Id: I7360fc0b8812fac2fdf280e62fe3da2652a152af Signed-off-by: shashikanth.vh --- diff --git a/aai-resources/src/main/java/org/openecomp/aai/rest/BulkConsumer.java b/aai-resources/src/main/java/org/openecomp/aai/rest/BulkConsumer.java index 951c9ff3..7ec6bbf0 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/rest/BulkConsumer.java +++ b/aai-resources/src/main/java/org/openecomp/aai/rest/BulkConsumer.java @@ -301,7 +301,7 @@ public abstract class BulkConsumer extends RESTAPI { actionElement = item.get("delete"); } - if (!actionElement.isJsonArray()) { + if ((actionElement == null) || !actionElement.isJsonArray()) { throw new AAIException("AAI_6111", "input payload does not follow bulk add interface"); } JsonArray httpArray = actionElement.getAsJsonArray();