Skip to content

Commit 710d634

Browse files
committed
Fix #4932
1 parent 7ced550 commit 710d634

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/test/java/com/fasterxml/jackson/databind/node/JsonNodeConversionsTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,4 +419,11 @@ public void testValueToTree() throws Exception
419419
assertEquals(wrapRootMapper.readValue(expected, Map.class), wrapRootMapper.readValue(wrapRootMapper.writeValueAsString(value), Map.class));
420420
assertEquals(wrapRootMapper.readValue(expected, Map.class), wrapRootMapper.readValue(wrapRootMapper.valueToTree(value).toString(), Map.class));
421421
}
422+
423+
// [databind#4932]: handling of `MissingNode` wrt conversions
424+
@Test
425+
void treeToValueWithMissingNode4932() throws Exception {
426+
assertNull(MAPPER.treeToValue(MAPPER.nullNode(), Object.class));
427+
assertNull(MAPPER.treeToValue(MAPPER.missingNode(), Object.class));
428+
}
422429
}

0 commit comments

Comments
 (0)