aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandan Ghosh <cghosh12@in.ibm.com>2018-08-29 12:33:48 +0530
committerChandan Ghosh <cghosh12@in.ibm.com>2018-08-29 12:33:56 +0530
commitc50e7b31496bb244ec627602f5ec368c0f9636fa (patch)
treee67a9c6e50cf12d605eb40447f727913ff2ca6bb
parent751f3e5b00130c4e04d42f917fd921dccb7f36cf (diff)
Added fix for potential nullpointer exception
Added fix for potential nullpointerexception reported in sonarqube Issue-ID: MUSIC-114 Change-Id: I6792a357534880fb85d353e2832b16aca2415c8b Signed-off-by: Chandan Ghosh <cghosh12@in.ibm.com>
-rwxr-xr-xsrc/main/java/org/onap/music/rest/RestMusicAdminAPI.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java b/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
index 48f28f8c..f28f236f 100755
--- a/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
+++ b/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
@@ -22,7 +22,6 @@
package org.onap.music.rest;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -506,19 +505,24 @@ public class RestMusicAdminAPI {
logger.info(operation+ ": Operation :: changeValue: "+changeValueMap);
if(operation.equals("update")) {
String notifyWhenChangeIn = baseRequestObj.getNotifyWhenChangeIn(); // conductor.plans.status
- if(field_value.equals(notifyWhenChangeIn)) {
- notifyCallBackAppl(jsonResponse, baseRequestObj);
+ if(null!=field_value) {
+ if(field_value.equals(notifyWhenChangeIn)) {
+ notifyCallBackAppl(jsonResponse, baseRequestObj);
+ }
}
-
} else if(operation.equals("delete")) {
String notifyWhenDeletesIn = baseRequestObj.getNotifyWhenDeletesIn(); // conductor.plans.status
- if(field_value.equals(notifyWhenDeletesIn)) {
- notifyCallBackAppl(jsonResponse, baseRequestObj);
+ if(null!=field_value) {
+ if(field_value.equals(notifyWhenDeletesIn)) {
+ notifyCallBackAppl(jsonResponse, baseRequestObj);
+ }
}
} else if(operation.equals("insert")) {
String notifyWhenInsertsIn = baseRequestObj.getNotifyWhenInsertsIn(); // conductor.plans.status
- if(field_value.equals(notifyWhenInsertsIn)) {
- notifyCallBackAppl(jsonResponse, baseRequestObj);
+ if(null!=field_value) {
+ if(field_value.equals(notifyWhenInsertsIn)) {
+ notifyCallBackAppl(jsonResponse, baseRequestObj);
+ }
}
}
MusicCore.releaseLock(lockId, true);