Skip to content

Commit 1209c84

Browse files
committed
allow custom object nodes
1 parent 9e3a311 commit 1209c84

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/fasterxml/jackson/databind/node/NodeCursor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,10 @@ protected final static class ObjectCursor
195195
public ObjectCursor(JsonNode n, NodeCursor p)
196196
{
197197
super(JsonStreamContext.TYPE_OBJECT, p);
198-
_contents = ((ObjectNode) n).fields();
198+
if (!n.isObject()) {
199+
throw new IllegalStateException("Current node is not an object node");
200+
}
201+
_contents = n.fields();
199202
_needEntry = true;
200203
}
201204

0 commit comments

Comments
 (0)