add additional null check to prevent exceptions 08/109908/1
authorBenjamin, Max <max.benjamin@att.com>
Tue, 7 Jul 2020 14:41:51 +0000 (10:41 -0400)
committerBenjamin, Max (mb388a) <mb388a@att.com>
Tue, 7 Jul 2020 14:41:51 +0000 (10:41 -0400)
add additional null check to prevent exceptions in logs

Issue-ID: SO-3031
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I9d338e68db9e2cfff5d0086a107b5d7bdd4bd703

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

index 5a52e3a..4206596 100644 (file)
@@ -104,7 +104,7 @@ public class ExecuteBuildingBlockRainyDay {
                 handlingCode = "Abort";
             } else {
                 try {
-                    if (gBBInput.getCustomer().getServiceSubscription() != null) {
+                    if (gBBInput.getCustomer() != null && gBBInput.getCustomer().getServiceSubscription() != null) {
                         serviceType = gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0)
                                 .getModelInfoServiceInstance().getServiceType();
                     }
@@ -119,7 +119,7 @@ public class ExecuteBuildingBlockRainyDay {
                 String vnfType = ASTERISK;
                 String vnfName = ASTERISK;
                 try {
-                    if (gBBInput.getCustomer().getServiceSubscription() != null) {
+                    if (gBBInput.getCustomer() != null && gBBInput.getCustomer().getServiceSubscription() != null) {
                         for (GenericVnf vnf : gBBInput.getCustomer().getServiceSubscription().getServiceInstances()
                                 .get(0).getVnfs()) {
                             if (vnf.getVnfId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID))) {
@@ -173,7 +173,7 @@ public class ExecuteBuildingBlockRainyDay {
 
                 String serviceRole = ASTERISK;
                 try {
-                    if (gBBInput.getCustomer().getServiceSubscription() != null) {
+                    if (gBBInput.getCustomer() != null && gBBInput.getCustomer().getServiceSubscription() != null) {
                         serviceRole = gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0)
                                 .getModelInfoServiceInstance().getServiceRole();
                     }