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

Handle nullable primitives before passing them to WritePrimitive… #54800

Merged

Conversation

StephenMolloy
Copy link
Member

Handle nullable primitives before passing them to WritePrimitive which expects non-null values.

XmlSerializer's WritePrimitive method is written to expect non-null values.
But primitive types can be nullable, and can be expected to be nullable in
serialization. This fix will check for a null primitive value before passing off to
WritePrimitive since null primitives are a simple null tag to write.

Fixes #421

@StephenMolloy StephenMolloy merged commit 88112bc into dotnet:main Jul 13, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal error while xml serializing a byte[] property set to null
4 participants