From: Oleksandr Moliavko Date: Tue, 9 Jul 2019 13:33:07 +0000 (+0300) Subject: Added check for null ptr before dereferencing at X-Git-Tag: 1.5.2~204^2~1 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=1164edb2678a4e6d827abe12d4a8dbb068e95875;p=so.git Added check for null ptr before dereferencing at gBBInput.getCustomer().getServiceSubscription() - to prevent static analyzer warning Issue-ID: SO-1841 Signed-off-by: Oleksandr Moliavko Change-Id: I5e1cb6248412ae9e3036011bd96d708f36170d70 --- diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java index b76316bf0e..b2dbd97bfc 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java @@ -60,7 +60,7 @@ public class ExtractPojosForBB { if (gBBInput.getCustomer().getServiceSubscription() == null && gBBInput.getServiceInstance() != null) { result = Optional.of((T) gBBInput.getServiceInstance()); - } else { + } else if (gBBInput.getCustomer().getServiceSubscription() != null) { result = lookupObjectInList( gBBInput.getCustomer().getServiceSubscription().getServiceInstances(), value); }