Skip to content

Handle null values gracefully in parseExtension #6797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MartijnMuijsers
Copy link

@MartijnMuijsers MartijnMuijsers commented Mar 13, 2025

parseChildren parseAlternates and parseExtension all invoke parseExtension after grabJsonArray. grabJsonArray may return a null value in the case of a JSON null (object.isNull()). Some JSON serializers tend to put "extension": null rather than leaving out "extension" in certain cases. This change makes sure our deserializer handles those inputs gracefully. (Currently, it throws a NullPointerException from within the parser at the theValues.size() call.)

`parseChildren` `parseAlternates` and `parseExtension` all invoke `parseExtension` after `grabJsonArray`. `grabJsonArray` may return a null value in the case of a JSON null (`object.isNull()`). Some JSON serializers tend to put `"extension": null` rather than leaving out `"extension"` in certain cases, and this makes sure our deserializer handles those inputs gracefully.
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.

1 participant