-Fixed deserializing a null string throwing a NullReferenceException
-Fixed JsonTextReader reading from a slow stream -Fixed CultureInfo not being overridden on JsonSerializerProxy -Fixed full trust security check in .NET 2.0 & .NET 3.5 -Improved writing JSON with indent performance
This commit is contained in:
@@ -117,7 +117,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
|
||||
if (reader.TokenType == JsonToken.None && !ReadForType(reader, contract, converter != null, false))
|
||||
{
|
||||
if (!contract.IsNullable)
|
||||
if (contract != null && !contract.IsNullable)
|
||||
throw new JsonSerializationException("No JSON content found and type '{0}' is not nullable.".FormatWith(CultureInfo.InvariantCulture, contract.UnderlyingType));
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user