aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter/src
diff options
context:
space:
mode:
authorChandan Ghosh <cghosh12@in.ibm.com>2018-12-03 15:17:18 +0530
committerChandan Ghosh <cghosh12@in.ibm.com>2018-12-03 15:18:06 +0530
commitf433847c5e9b3f49b8c3f109f75de20ad5e995d5 (patch)
treeadbc341b2ef23d14a04fe6fd5bc9ea4002a21db5 /adapters/mso-catalog-db-adapter/src
parent9a3841eadc588c3b3f50f2351b741edd139ca13c (diff)
Added check for nullpointer exception
Added check for nullpointer exception Issue-ID: SO-1263 Change-Id: I6a888643e3232426773b8785b224732f51983734 Signed-off-by: Chandan Ghosh <cghosh12@in.ibm.com>
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src')
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java5
1 files changed, 3 insertions, 2 deletions
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);