-Fixed deserializing empty strings in Hashtables

This commit is contained in:
James Newton-King
2015-01-27 00:00:53 +13:00
parent 0657fd9b44
commit e8ca53e788
2 changed files with 14 additions and 1 deletions
@@ -279,7 +279,7 @@ namespace Newtonsoft.Json.Serialization
string s = (string)reader.Value;
// convert empty string to null automatically for nullable types
if (string.IsNullOrEmpty(s) && objectType != typeof(string) && objectType != typeof(object) && contract != null && contract.IsNullable)
if (string.IsNullOrEmpty(s) && objectType != null && objectType != typeof(string) && objectType != typeof(object) && contract != null && contract.IsNullable)
return null;
// string that needs to be returned as a byte array should be base 64 decoded