Skip to content

NPE when visiting StaticListSerializerBase #2079

@WorldSEnder

Description

@WorldSEnder

I am using jackson 2.7 but when looking through the code, the issue will most likely remain after upgrading.

The problem has it's roots here

public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException {
acceptContentVisitor(visitor.expectArrayFormat(typeHint));
}

If the visitor returns null from expectArrayFormat (as for example by inheriting from JsonFormatVisitorWrapper.Base) then a NullPointerException will be raised from the following places

protected void acceptContentVisitor(JsonArrayFormatVisitor visitor) throws JsonMappingException {
visitor.itemsFormat(JsonFormatTypes.STRING);
}
protected void acceptContentVisitor(JsonArrayFormatVisitor visitor) throws JsonMappingException
{
visitor.itemsFormat(JsonFormatTypes.STRING);
}
.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions