remove redundant check for IsNullableType (#1450)
This commit is contained in:
committed by
James Newton-King
parent
ab3315f1d5
commit
8f65999684
@@ -126,7 +126,7 @@ namespace Newtonsoft.Json.Converters
|
||||
bool nullable = ReflectionUtils.IsNullableType(objectType);
|
||||
if (reader.TokenType == JsonToken.Null)
|
||||
{
|
||||
if (!ReflectionUtils.IsNullableType(objectType))
|
||||
if (!nullable)
|
||||
{
|
||||
throw JsonSerializationException.Create(reader, "Cannot convert null value to {0}.".FormatWith(CultureInfo.InvariantCulture, objectType));
|
||||
}
|
||||
@@ -194,4 +194,4 @@ namespace Newtonsoft.Json.Converters
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user