mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-10-27 00:17:31 +00:00
Merge branch 'master' of https://github.com/JKorf/CryptoExchange.Net
This commit is contained in:
commit
bb3a534f75
@ -140,10 +140,10 @@ namespace CryptoExchange.Net.Converters.SystemTextJson
|
|||||||
_ => throw new Exception("Invalid token type for enum deserialization: " + reader.TokenType)
|
_ => throw new Exception("Invalid token type for enum deserialization: " + reader.TokenType)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(stringValue))
|
if (stringValue is null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (!GetValue(enumType, stringValue!, out var result))
|
if (!GetValue(enumType, stringValue, out var result))
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(stringValue))
|
if (string.IsNullOrWhiteSpace(stringValue))
|
||||||
{
|
{
|
||||||
@ -204,6 +204,13 @@ namespace CryptoExchange.Net.Converters.SystemTextJson
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(value))
|
||||||
|
{
|
||||||
|
// An empty/null value will always fail when parsing, so just return here
|
||||||
|
result = default;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// If no explicit mapping is found try to parse string
|
// If no explicit mapping is found try to parse string
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user