1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-07 16:06:15 +00:00

Added fallback for unparsable value in System.Text.Json NumberStringConverter

This commit is contained in:
Jkorf 2024-10-09 15:42:11 +02:00
parent 71ee263683
commit 168dabc11f

View File

@ -23,8 +23,15 @@ namespace CryptoExchange.Net.Converters.SystemTextJson
return reader.GetDecimal().ToString(); return reader.GetDecimal().ToString();
} }
try
{
return reader.GetString(); return reader.GetString();
} }
catch (Exception)
{
return null;
}
}
/// <inheritdoc /> /// <inheritdoc />
public override void Write(Utf8JsonWriter writer, string? value, JsonSerializerOptions options) public override void Write(Utf8JsonWriter writer, string? value, JsonSerializerOptions options)