aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandan Ghosh <cghosh12@in.ibm.com>2018-12-03 14:27:48 +0530
committerChandan Ghosh <cghosh12@in.ibm.com>2018-12-03 14:27:54 +0530
commitfb07209408b026e1eac2258332d6e93d927f8236 (patch)
treeadbc341b2ef23d14a04fe6fd5bc9ea4002a21db5
parent9a3841eadc588c3b3f50f2351b741edd139ca13c (diff)
Added fix for potential nullpointer exception
Added fix for potential nullpointerexception Issue-ID: SO-1263 Change-Id: Iaf7ab5b170ddcca03f597ab9f9a951afcee2d2f9 Signed-off-by: Chandan Ghosh <cghosh12@in.ibm.com>
-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);