NickCraver / StackExchange.Exceptional

Error handler used for the Stack Exchange network
https://nickcraver.com/StackExchange.Exceptional/
Apache License 2.0
863 stars 171 forks source link

Return null from GetPairs/GetNameValueCollection if value is null #43

Closed rossipedia closed 10 years ago

rossipedia commented 10 years ago

During deserialization of a List<> property, Json.net first checks to see if the property is null. If not, then it avoids calling the property set and simply calls Add() to the value returned by the get.

If the property is null, then it will create the list, and then call the set on that property.

This change makes the collection properties of the Error class work with Json.net. JavascriptSerializer is unaffected and should work as it did previously.