From 8f65999684309bf32bce1045c8ee8aeb4e0c8d0e Mon Sep 17 00:00:00 2001 From: zivillian Date: Mon, 2 Oct 2017 05:00:21 +0200 Subject: [PATCH] remove redundant check for IsNullableType (#1450) --- Src/Newtonsoft.Json/Converters/IsoDateTimeConverter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Newtonsoft.Json/Converters/IsoDateTimeConverter.cs b/Src/Newtonsoft.Json/Converters/IsoDateTimeConverter.cs index 52490131..312a8595 100644 --- a/Src/Newtonsoft.Json/Converters/IsoDateTimeConverter.cs +++ b/Src/Newtonsoft.Json/Converters/IsoDateTimeConverter.cs @@ -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 } } } -} \ No newline at end of file +}