Skip to content

Commit

Permalink
fix value in JsonObjects name/value pair cannot be null
Browse files Browse the repository at this point in the history
  • Loading branch information
huboliang authored and jmartisk committed Jan 16, 2024
1 parent 1c7fb83 commit 0445a50
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,16 @@ private void addKeyValue(JsonObjectBuilder objectBuilder, String key, String val
}

private void addKeyValue(JsonObjectBuilder objectBuilder, String key, JsonValue value) {
if (value == null) {
return;
}
if (config.getErrorExtensionFields().isPresent()) {
List<String> fieldsThatShouldBeIncluded = config.getErrorExtensionFields().get();
if (fieldsThatShouldBeIncluded.contains(key)) {
objectBuilder.add(key, value);
}
} else {
if (value != null) {
objectBuilder.add(key, value);
}
objectBuilder.add(key, value);
}
}

Expand Down

0 comments on commit 0445a50

Please sign in to comment.