Skip to content

Commit

Permalink
Add check for null string to decimal converter
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Aug 5, 2024
1 parent e3fece4 commit 7be75f7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class DecimalConverter : JsonConverter<decimal?>
if (reader.TokenType == JsonTokenType.String)
{
var value = reader.GetString();
if (string.IsNullOrEmpty(value))
if (string.IsNullOrEmpty(value) || string.Equals("null", value))
return null;

return decimal.Parse(value, NumberStyles.Float, CultureInfo.InvariantCulture);
Expand Down

0 comments on commit 7be75f7

Please sign in to comment.