Skip to content

Malformed json causes BasicJsonParser to throw a NullPointerException #31301

Closed
@philwebb

Description

@philwebb

Adding the following to AbstractJsonParserTests will cause all our parser implementations to fail, however, BasicJsonParser fails with an ugly NullPointerException rather than something that tells the user that the JSON is bad:

@Test
void malformedJson() {
    String input = "[tru,erqett,{\"foo\":fatrue,true,true,true,tr''ue}]";
    List<Object> list = this.parser.parseList(input);
    assertThat(list).hasSize(3);
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions