From 70252f03c8c2b3e7ae17ea9963d20a93370390e2 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Sat, 23 Mar 2019 10:26:54 -0400 Subject: Fix a NullPointerException on getting no data from Fix a NullPointerException on getting no data from the Catalog DB. Change-Id: Ibeb7206f2427104623943f964afff377ca666d28 Issue-ID: SO-1695 Signed-off-by: Benjamin, Max (mb388a) --- .../main/java/org/onap/so/db/catalog/client/CatalogDbClient.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java index 2faac31f2d..3e35e78e7a 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java @@ -808,10 +808,12 @@ public class CatalogDbClient { public VnfVfmoduleCvnfcConfigurationCustomization getVnfVfmoduleCvnfcConfigurationCustomizationByVnfCustomizationUuidAndVfModuleCustomizationUuidAndCvnfcCustomizationUuid( String vnfCustomizationUuid, String vfModuleCustomizationUuid, String cvnfcCustomizationUuid) { CvnfcCustomization cvnfc = getCvnfcCustomizationByCustomizationUUID(cvnfcCustomizationUuid); - for(VnfVfmoduleCvnfcConfigurationCustomization vnfVfModuleCvnfcCust: cvnfc.getVnfVfmoduleCvnfcConfigurationCustomization()){ - if(vnfVfModuleCvnfcCust.getVnfResourceCustomization().getModelCustomizationUUID().equals(vnfCustomizationUuid) && + if (cvnfc != null) { + for(VnfVfmoduleCvnfcConfigurationCustomization vnfVfModuleCvnfcCust: cvnfc.getVnfVfmoduleCvnfcConfigurationCustomization()){ + if(vnfVfModuleCvnfcCust.getVnfResourceCustomization().getModelCustomizationUUID().equals(vnfCustomizationUuid) && vnfVfModuleCvnfcCust.getVfModuleCustomization().getModelCustomizationUUID().equals(vfModuleCustomizationUuid)){ return vnfVfModuleCvnfcCust; + } } } return null; -- cgit 1.2.3-korg