From e3d58c2d251f39020a5ef2a52d129239679eeeaa Mon Sep 17 00:00:00 2001 From: JKorf Date: Mon, 25 Jun 2018 08:44:01 +0200 Subject: [PATCH] Added nullable to type check of baseconverter --- CryptoExchange.Net/Converters/BaseConverter.cs | 3 ++- CryptoExchange.Net/CryptoExchange.Net.csproj | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CryptoExchange.Net/Converters/BaseConverter.cs b/CryptoExchange.Net/Converters/BaseConverter.cs index e63b779..0850648 100644 --- a/CryptoExchange.Net/Converters/BaseConverter.cs +++ b/CryptoExchange.Net/Converters/BaseConverter.cs @@ -48,7 +48,8 @@ namespace CryptoExchange.Net.Converters public override bool CanConvert(Type objectType) { - return objectType == typeof(T); + // Check if it is type, or nullable of type + return objectType == typeof(T) || Nullable.GetUnderlyingType(objectType) == typeof(T); } } } diff --git a/CryptoExchange.Net/CryptoExchange.Net.csproj b/CryptoExchange.Net/CryptoExchange.Net.csproj index 8f9aad9..94d538e 100644 --- a/CryptoExchange.Net/CryptoExchange.Net.csproj +++ b/CryptoExchange.Net/CryptoExchange.Net.csproj @@ -7,7 +7,7 @@ CryptoExchange.Net JKorf - 0.0.27 + 0.0.28 false https://github.com/JKorf/CryptoExchange.Net https://github.com/JKorf/CryptoExchange.Net/blob/master/LICENSE