Skip to content

Commit

Permalink
Avoid NPE if an error extension field is null
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartisk committed Jan 17, 2024
1 parent 763c2cf commit 95131c9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ private void populateCustomExtensions(JsonObjectBuilder objectBuilder, Map<Strin
if (config.getErrorExtensionFields().isEmpty()
|| (config.getErrorExtensionFields().isPresent()
&& config.getErrorExtensionFields().get().contains(entry.getKey()))) {
addKeyValue(objectBuilder, entry.getKey(), entry.getValue().toString());
Object value = entry.getValue();
addKeyValue(objectBuilder, entry.getKey(), value != null ? value.toString() : null);
}
}
}
Expand Down

0 comments on commit 95131c9

Please sign in to comment.