summaryrefslogtreecommitdiffstats
path: root/appc-dispatcher/appc-request-handler
diff options
context:
space:
mode:
authorSkip Wonnell <kw5258@att.com>2017-08-03 14:58:41 -0500
committerSkip Wonnell <kw5258@att.com>2017-08-03 15:02:36 -0500
commitbdc69bf1339cf2599fe67d26ff9bbbaa3c07957a (patch)
tree46c40c9158140fd4f39537a678c619d38c78cb09 /appc-dispatcher/appc-request-handler
parent38713207b817ed4700f630748c681116338d32f0 (diff)
Avoid possible NEP in WorkingStateManagerImpl.java
Squashed commit of the following: commit 7f62d9a1fa166aa55579795b7a592e22a6df3772 Author: Skip Wonnell <kw5258@att.com> Date: Thu Aug 3 13:22:22 2017 -0500 [APPC-92] Fix sonar blocker issue Check vnfWorkingStateDto for null before dereference. Change-Id: I4630df4bcd3d696041123e1fc0267c46a756425b Signed-off-by: Skip Wonnell <kw5258@att.com> Issue: APPC-92
Diffstat (limited to 'appc-dispatcher/appc-request-handler')
-rw-r--r--appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/workingstatemanager/impl/WorkingStateManagerImpl.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/workingstatemanager/impl/WorkingStateManagerImpl.java b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/workingstatemanager/impl/WorkingStateManagerImpl.java
index 2e70542a1..3431d2774 100644
--- a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/workingstatemanager/impl/WorkingStateManagerImpl.java
+++ b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/workingstatemanager/impl/WorkingStateManagerImpl.java
@@ -125,7 +125,8 @@ public class WorkingStateManagerImpl extends JdbcWorkingStateManager {
boolean updated = false;
VnfWorkingStateDto vnfWorkingStateDto = retrieveVnfWorkingState(connection, vnfId);
Long currentVersion = vnfWorkingStateDto != null ? vnfWorkingStateDto.getVer() : null;
- if(forceFlag || isVNFStable(vnfWorkingStateDto) || vnfWorkingStateDto.getOwnerId().equals(ownerId)){
+ if(forceFlag || isVNFStable(vnfWorkingStateDto) ||
+ ( vnfWorkingStateDto != null && vnfWorkingStateDto.getOwnerId().equals(ownerId)) ) {
updated = storeWorkingStateIfSameVersion(connection, vnfId, workingState, ownerId, currentVersion);
Params params = new Params().addParam("vnfId", vnfId).addParam("workingState",workingState.name())