diff options
author | Bharath Balasubramanian <bharathb@research.att.com> | 2018-08-28 11:56:14 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-08-28 11:56:14 +0000 |
commit | 8e7e000bd7da86c460841ae9d6deb52541cded87 (patch) | |
tree | 7154e6e60673799b4e9dfb00442c74b52c2ee627 /src/main | |
parent | c2e7e16d876a7a08d8149ee1c7c300346d38a4b4 (diff) | |
parent | bc6260e4b214d8a1544e653a3f6a63d525ac9d7a (diff) |
Merge "MusicCore.java : Fixed sonar issue"
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/onap/music/main/MusicCore.java | 8 |
1 files changed, 6 insertions, 2 deletions
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!"); |