Skip to content
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

Record deserialization throws NRE if ignore null values is on #164

Closed
mlaily opened this issue Jul 5, 2023 · 0 comments · Fixed by #166
Closed

Record deserialization throws NRE if ignore null values is on #164

mlaily opened this issue Jul 5, 2023 · 0 comments · Fixed by #166
Labels
bug Something isn't working

Comments

@mlaily
Copy link

mlaily commented Jul 5, 2023

Hello!

It seems there is some issue with the JsonRecordConverter: when ignoreNullValues is on (e.g. set with option DefaultIgnoreCondition = Serialization.JsonIgnoreCondition.WhenWritingNull), attempting to deserialize an empty json object throws a NullReferenceException.

I'm not sure how to fix this properly, but I managed to add a failing unit test demonstrating the issue: #165

image

@Tarmil Tarmil added the bug Something isn't working label Jul 7, 2023
Tarmil added a commit that referenced this issue Jul 7, 2023
Tarmil added a commit that referenced this issue Jul 22, 2023
fix #164: NRE on deserializing missing field with JsonIgnoreCondition.WhenWritingNull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants