diff options
author | Chandan Ghosh <cghosh12@in.ibm.com> | 2018-12-03 14:27:48 +0530 |
---|---|---|
committer | Chandan Ghosh <cghosh12@in.ibm.com> | 2018-12-03 14:27:54 +0530 |
commit | fb07209408b026e1eac2258332d6e93d927f8236 (patch) | |
tree | adbc341b2ef23d14a04fe6fd5bc9ea4002a21db5 | |
parent | 9a3841eadc588c3b3f50f2351b741edd139ca13c (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.java | 5 |
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); |