From f433847c5e9b3f49b8c3f109f75de20ad5e995d5 Mon Sep 17 00:00:00 2001 From: Chandan Ghosh Date: Mon, 3 Dec 2018 15:17:18 +0530 Subject: Added check for nullpointer exception Added check for nullpointer exception Issue-ID: SO-1263 Change-Id: I6a888643e3232426773b8785b224732f51983734 Signed-off-by: Chandan Ghosh --- .../org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'adapters/mso-catalog-db-adapter/src/main') diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java index 2fc1c3d70a..e9018dd7be 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java @@ -580,8 +580,9 @@ public class CatalogDbAdapterRest { if (null == recipe) { NetworkResource nResource = networkResourceRepo.findResourceByModelUUID(rmUuid); - recipe = networkRecipeRepo.findFirstByModelNameAndActionAndVersionStr(nResource.getModelName(), action, vnf.getModelVersion()); - + if(null!=vnf) { + recipe = networkRecipeRepo.findFirstByModelNameAndActionAndVersionStr(nResource.getModelName(), action, vnf.getModelVersion()); + } // for network fetch the default recipe if (recipe == null) { recipe = networkRecipeRepo.findFirstByModelNameAndAction("SDNC_DEFAULT", action); -- cgit 1.2.3-korg