Skip to content

Commit b2a6ca6

Browse files
authored
skip unknown nested key
1 parent 3759476 commit b2a6ca6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

protobuf/src/main/java/com/fasterxml/jackson/dataformat/protobuf/ProtobufParser.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,10 @@ private JsonToken _handleNestedKey(int tag) throws IOException
736736
if ((_currentField == null) || (f = _currentField.nextOrThisIf(id)) == null) {
737737
f = _currentMessage.field(id);
738738
}
739+
// Note: may be null; if so, value needs to be skipped
740+
if (f == null) {
741+
return _skipUnknownField(id, wireType);
742+
}
739743
_parsingContext.setCurrentName(f.name);
740744
if (!f.isValidFor(wireType)) {
741745
_reportIncompatibleType(f, wireType);

0 commit comments

Comments
 (0)