Added check for nullpointer exception 25/74125/1
authorChandan Ghosh <cghosh12@in.ibm.com>
Mon, 3 Dec 2018 09:47:18 +0000 (15:17 +0530)
committerChandan Ghosh <cghosh12@in.ibm.com>
Mon, 3 Dec 2018 09:48:06 +0000 (15:18 +0530)
Added check for nullpointer exception

Issue-ID: SO-1263
Change-Id: I6a888643e3232426773b8785b224732f51983734
Signed-off-by: Chandan Ghosh <cghosh12@in.ibm.com>
adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java

index 2fc1c3d..e9018dd 100644 (file)
@@ -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);