diff options
author | William Reehil <william.reehil@att.com> | 2020-06-23 20:08:41 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-06-23 20:08:41 +0000 |
commit | e72835a7bb6568f3320f3e437ce054fea2804ae4 (patch) | |
tree | cdf1cbc9c3a72332a485f90d98a2be4b3a0a1bd4 /aai-core | |
parent | 273d54c0277aff18e1b4e14e53adbd51bac67e8d (diff) | |
parent | 017c95fc8016787d17d060b586c3f5bd52582a04 (diff) |
Merge "Fix sonar issues in Aggregate"
Diffstat (limited to 'aai-core')
-rw-r--r-- | aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java index b7627267..9ce343f6 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java @@ -129,7 +129,7 @@ public class Aggregate extends MultiFormatMapper { json.addProperty(prop.key(), gson.toJson(prop.value())); } else { // throw exception? - return null; + return Optional.empty(); } } } else { @@ -214,7 +214,7 @@ public class Aggregate extends MultiFormatMapper { json.add(inner); } else { Optional<JsonObject> obj = this.getJsonFromVertex((Vertex)l, properties); - json.add(obj.get()); + if(obj.isPresent()) json.add(obj.get()); } } return Optional.of(json); |