diff options
author | Oleksandr Moliavko <o.moliavko@samsung.com> | 2019-08-01 17:25:47 +0300 |
---|---|---|
committer | Oleksandr Moliavko <o.moliavko@samsung.com> | 2019-08-01 17:25:47 +0300 |
commit | 999cef4607e6d2c89a23a634a1067ebd087bd71c (patch) | |
tree | 71863ea68fd158cc7b3b03806c0bac41df9213db /bpmn/MSOCommonBPMN | |
parent | 0bf3a7f44ca4f0101c972029c7254606793627ad (diff) |
Added null checks to prevent crashes at
method calls
Issue-ID: SO-1841
Signed-off-by: Oleksandr Moliavko <o.moliavko@samsung.com>
Change-Id: Ie3b70aa59cf73ca6203d0f1aab1ed096af906050
Diffstat (limited to 'bpmn/MSOCommonBPMN')
-rw-r--r-- | bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index 9a39334af1..433aa0c11a 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -1388,8 +1388,10 @@ public class BBInputSetup implements JavaDelegate { vnfs.getInstanceParams(), productFamilyId); } else if (bbName.contains(VF_MODULE) || bbName.contains(VOLUME_GROUP)) { Pair<Vnfs, VfModules> vnfsAndVfModules = getVfModulesAndItsVnfsByKey(key, resources); - vfModules = vnfsAndVfModules.getValue1(); - vnfs = vnfsAndVfModules.getValue0(); + if (vnfsAndVfModules != null) { + vfModules = vnfsAndVfModules.getValue1(); + vnfs = vnfsAndVfModules.getValue0(); + } lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, getVnfId(executeBB, lookupKeyMap)); if (vnfs == null) { throw new Exception("Could not find Vnf to orchestrate VfModule"); @@ -1410,8 +1412,10 @@ public class BBInputSetup implements JavaDelegate { } else if (bbName.contains(NETWORK)) { networks = findNetworksByKey(key, resources); String networkId = lookupKeyMap.get(ResourceKey.NETWORK_ID); - this.populateL3Network(networks.getInstanceName(), networks.getModelInfo(), service, bbName, - serviceInstance, lookupKeyMap, networkId, networks.getInstanceParams()); + if (networks != null) { + this.populateL3Network(networks.getInstanceName(), networks.getModelInfo(), service, bbName, + serviceInstance, lookupKeyMap, networkId, networks.getInstanceParams()); + } } else if (bbName.contains("Configuration")) { String configurationId = lookupKeyMap.get(ResourceKey.CONFIGURATION_ID); ModelInfo configurationModelInfo = new ModelInfo(); @@ -1608,8 +1612,10 @@ public class BBInputSetup implements JavaDelegate { protected void mapCatalogNetworkCollectionInstanceGroup(Service service, InstanceGroup instanceGroup, String key) { CollectionResourceCustomization collectionCust = this.findCatalogNetworkCollection(service, key); - org.onap.so.db.catalog.beans.InstanceGroup catalogInstanceGroup = - collectionCust.getCollectionResource().getInstanceGroup(); + org.onap.so.db.catalog.beans.InstanceGroup catalogInstanceGroup = null; + if (collectionCust != null) { + catalogInstanceGroup = collectionCust.getCollectionResource().getInstanceGroup(); + } instanceGroup.setModelInfoInstanceGroup( mapperLayer.mapCatalogInstanceGroupToInstanceGroup(collectionCust, catalogInstanceGroup)); } |