Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4145 by adding null checks #4146

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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