-Changed null values in JToken extension data dictionary to be JTokenType.Null

This commit is contained in:
James Newton-King
2014-02-23 11:15:45 +13:00
parent ff66b3cfc9
commit e83bb41094
2 changed files with 23 additions and 7 deletions
@@ -482,8 +482,8 @@ namespace Newtonsoft.Json.Serialization
// convert object value to JToken so it is compatible with dictionary
// could happen because of primitive types, type name handling and references
if (isJTokenValueType && !(value is JToken) && value!=null)
value = JToken.FromObject(value);
if (isJTokenValueType && !(value is JToken))
value = (value != null) ? JToken.FromObject(value) : new JValue(null, JTokenType.Null);
setExtensionDataDictionaryValue(dictionary, key, value);
};