-Fixed empty string being changed to null on object properties

This commit is contained in:
JamesNK
2012-02-05 23:20:29 +00:00
parent 6ce847411a
commit ea72817034
2 changed files with 13 additions and 1 deletions
@@ -244,7 +244,7 @@ namespace Newtonsoft.Json.Serialization
return EnsureType(reader, reader.Value, CultureInfo.InvariantCulture, contract, objectType);
case JsonToken.String:
// convert empty string to null automatically for nullable types
if (string.IsNullOrEmpty((string) reader.Value) && objectType != typeof(string) && contract.IsNullable)
if (string.IsNullOrEmpty((string)reader.Value) && objectType != typeof(string) && objectType != typeof(object) && contract.IsNullable)
return null;
// string that needs to be returned as a byte array should be base 64 decoded