Added check for null ptr before dereferencing at 91/91091/3
authorOleksandr Moliavko <o.moliavko@samsung.com>
Tue, 9 Jul 2019 13:33:07 +0000 (16:33 +0300)
committerOleksandr Moliavko <o.moliavko@samsung.com>
Fri, 12 Jul 2019 10:03:02 +0000 (13:03 +0300)
gBBInput.getCustomer().getServiceSubscription() -
to prevent static analyzer warning

Issue-ID: SO-1841
Signed-off-by: Oleksandr Moliavko <o.moliavko@samsung.com>
Change-Id: I5e1cb6248412ae9e3036011bd96d708f36170d70

bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java

index b76316b..b2dbd97 100644 (file)
@@ -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);
                     }