Skip to content

Commit

Permalink
Added check for datetime year 1 to be deserialized as null
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Oct 4, 2024
1 parent 1f31e4a commit c614b78
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerial
var stringValue = reader.GetString();
if (string.IsNullOrWhiteSpace(stringValue)
|| stringValue == "-1"
|| stringValue == "0001-01-01T00:00:00Z"
|| double.TryParse(stringValue, out var doubleVal) && doubleVal == 0)
{
return default;
Expand Down

0 comments on commit c614b78

Please sign in to comment.