Skip to content

Add null check in JsonObjectReader close() implementations#5374

Open
hqqw2h-lgtm wants to merge 1 commit intospring-projects:mainfrom
hqqw2h-lgtm:gh-5281
Open

Add null check in JsonObjectReader close() implementations#5374
hqqw2h-lgtm wants to merge 1 commit intospring-projects:mainfrom
hqqw2h-lgtm:gh-5281

Conversation

@hqqw2h-lgtm
Copy link
Copy Markdown

@hqqw2h-lgtm hqqw2h-lgtm commented Apr 4, 2026

JacksonJsonObjectReader.close() and GsonJsonObjectReader.close() throw NullPointerException when close() is called after open() fails. Added null checks for inputStream and parser/reader fields. Added test to verify close() is null-safe after a failed open(). Closes #5281

JacksonJsonObjectReader.close() and GsonJsonObjectReader.close()
now handle the case where open() failed and inputStream/parser
were never initialized.

Closes spring-projects#5281

Signed-off-by: hanweiwei <duzielww@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NullPointerException in JacksonJsonObjectReader.close() and GsonJsonObjectReader.close()

2 participants