diff options
author | Krishnajinka <kris.jinka@samsung.com> | 2018-07-06 17:28:54 +0900 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-07-10 14:40:24 +0000 |
commit | ec248ffb74f1c038fdd6c7a77411f628ef51366f (patch) | |
tree | a790240451325798417300472b31a86993987160 /appc-dg/appc-dg-shared/appc-dg-dependency-model | |
parent | 72dbb19dd424ef559422bd0243d6a3179e01c382 (diff) |
null ptr check
rework based on review comments
Issue-ID: APPC-1047
Change-Id: Ia87707535dc5825d18a6c35fdae416064dcb8c14
Signed-off-by: Krishnajinka <kris.jinka@samsung.com>
Diffstat (limited to 'appc-dg/appc-dg-shared/appc-dg-dependency-model')
-rw-r--r-- | appc-dg/appc-dg-shared/appc-dg-dependency-model/src/main/java/org/onap/appc/dg/dependencymanager/impl/DependencyManagerImpl.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/appc-dg/appc-dg-shared/appc-dg-dependency-model/src/main/java/org/onap/appc/dg/dependencymanager/impl/DependencyManagerImpl.java b/appc-dg/appc-dg-shared/appc-dg-dependency-model/src/main/java/org/onap/appc/dg/dependencymanager/impl/DependencyManagerImpl.java index 82891b02d..ecd3c0305 100644 --- a/appc-dg/appc-dg-shared/appc-dg-dependency-model/src/main/java/org/onap/appc/dg/dependencymanager/impl/DependencyManagerImpl.java +++ b/appc-dg/appc-dg-shared/appc-dg-dependency-model/src/main/java/org/onap/appc/dg/dependencymanager/impl/DependencyManagerImpl.java @@ -55,6 +55,11 @@ public class DependencyManagerImpl implements DependencyManager { if(dependencyModel == null){ logger.debug("Dependency model not found in cache, creating strategy for reading it"); DependencyType strategy = getStrategy(dependencyType); + // Throw exception if strategy could not be created because it is required + // to retrieve the vnfc dependency model later + if (strategy == null) { + throw new NullPointerException("Strategy is null. Failed to retrieve Vnfc Dependency Model"); + } dependencyModel = strategy.getVnfcDependencyModel(modelIdentifier); } if (logger.isTraceEnabled()) { |