Skip to content

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 requested review from HongGit and mconnew June 28, 2021 01:32
@ghost ghost added the area-Serialization label Jun 28, 2021
@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