Skip to content

Commit

Permalink
Merge pull request #2326 from telefonicaid/task/check_isJsonNull_befo…
Browse files Browse the repository at this point in the history
…re_getAsString

check if isJsonNull before getAsString
  • Loading branch information
fgalan authored Dec 1, 2023
2 parents e4c7a60 + a269e16 commit c83f2be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

- [cygnus-common][NGSIGenericColumnAggregator] Fix getValue when gson object is null

Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,10 @@ public String getValue() {
return value.getAsJsonObject().toString();
} else if (value.isJsonArray()) {
return value.getAsJsonArray().toString();
} else {
} else if (!value.isJsonNull()){
return "\"" + value.getAsString() + "\"";
} else {
return "\"" + value.toString() + "\"";
} // if else if
} // getValue

Expand Down

0 comments on commit c83f2be

Please sign in to comment.