remove redundant check for IsNullableType (#1450)

This commit is contained in:
zivillian
2017-10-02 16:00:21 +13:00
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
}
}
}
}
}