Skip to content

Commit

Permalink
Fix #4145 by adding null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Oct 7, 2023
1 parent 254eb26 commit c95efce
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,9 @@ Freddy Boucher (freddyboucher@github)
Ondrej Zizka (OndraZizk@github)
* Reported #1999: "Duplicate property" issue should mention which class it complains about
(2.9.6)
* Repoted #4145: NPE when transforming a tree to a model class object,
at `ArrayNode.elements()`
(2.16.0)

Jakub Skierbiszewski (jskierbi@github)
* Reported, contributed fix for #2001: Deserialization issue with `@JsonIgnore` and
Expand Down
2 changes: 2 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ Project: jackson-databind
wrt argument
#4122: Do not resolve wildcards if upper bound is too non-specific
(contributed by @yawkat)
#4145: NPE when transforming a tree to a model class object, at `ArrayNode.elements()`
(reported by Ondrej Z)

2.15.3 (not yet released)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public ArrayNode(JsonNodeFactory nf, int capacity) {
*/
public ArrayNode(JsonNodeFactory nf, List<JsonNode> children) {
super(nf);
_children = children;
_children = Objects.requireNonNull(children,
"Must not pass `null` for 'children' argument");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ public ObjectNode(JsonNodeFactory nc) {
/**
* @since 2.4
*/
public ObjectNode(JsonNodeFactory nc, Map<String, JsonNode> kids) {
public ObjectNode(JsonNodeFactory nc, Map<String, JsonNode> children) {
super(nc);
_children = kids;
_children = Objects.requireNonNull(children,
"Must not pass `null` for 'children' argument");
}

@Override
Expand Down

0 comments on commit c95efce

Please sign in to comment.