aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java2
-rw-r--r--src/main/java/org/onap/music/main/MusicCore.java8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java b/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java
index 0fc9ffe3..c97ccfab 100644
--- a/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java
+++ b/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java
@@ -335,7 +335,7 @@ public class MusicConditional {
Map<String, String> finalValues = new HashMap<>();
values = (Map<String, String>) columnValue;
- if (values.keySet().contains(planId)) {
+ if (values != null && values.keySet().contains(planId)) {
String valueString = values.get(planId);
String tempValueString = valueString.replaceAll("\\{", "").replaceAll("\"", "").replaceAll("\\}", "");
String[] elements = tempValueString.split(",");
diff --git a/src/main/java/org/onap/music/main/MusicCore.java b/src/main/java/org/onap/music/main/MusicCore.java
index b729ba74..aaaeae34 100644
--- a/src/main/java/org/onap/music/main/MusicCore.java
+++ b/src/main/java/org/onap/music/main/MusicCore.java
@@ -73,7 +73,10 @@ public class MusicCore {
public boolean testCondition() throws Exception {
// first generate the row
ResultSet results = quorumGet(selectQueryForTheRow);
- Row row = results.one();
+ Row row = null;
+ if(results != null) {
+ row = results.one();
+ }
return getDSHandle().doesRowSatisfyCondition(row, conditions);
}
}
@@ -288,7 +291,8 @@ public class MusicCore {
MusicLockState newMls = null;
try {
currentMls = getMusicLockState(key);
- String currentLockHolder = currentMls.getLockHolder();
+ String currentLockHolder = null;
+ if(currentMls != null) { currentLockHolder = currentMls.getLockHolder(); };
if (lockId.equals(currentLockHolder)) {
logger.info(EELFLoggerDelegate.applicationLogger,"In acquire lock: You already have the lock!");
return new ReturnType(ResultType.SUCCESS, "You already have the lock!");