From: Chandan Ghosh Date: Wed, 29 Aug 2018 07:03:48 +0000 (+0530) Subject: Added fix for potential nullpointer exception X-Git-Tag: 3.0.23~26^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=c50e7b31496bb244ec627602f5ec368c0f9636fa;p=music.git 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 --- 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);