-Fixed error when writing JSON for a JProperty with no value

-LINQ to JSON performance improvements
This commit is contained in:
James Newton-King
2012-08-11 20:12:49 +12:00
parent 7359433dc7
commit f5fec30c2a
6 changed files with 78 additions and 29 deletions
+4 -1
View File
@@ -528,7 +528,10 @@ namespace Newtonsoft.Json.Linq
}
JsonConverter matchingConverter;
if (_value != null && ((matchingConverter = JsonSerializer.GetMatchingConverter(converters, _value.GetType())) != null))
if (_value != null
&& converters != null
&& converters.Length > 0
&& ((matchingConverter = JsonSerializer.GetMatchingConverter(converters, _value.GetType())) != null))
{
matchingConverter.WriteJson(writer, _value, new JsonSerializer());
return;