Serialize Guid.Empty to null

This commit is contained in:
crobibero 2020-11-23 16:07:15 -07:00
parent 02c1879533
commit c4925ad70b
1 changed files with 10 additions and 1 deletions

View File

@ -15,6 +15,15 @@ namespace MediaBrowser.Common.Json.Converters
/// <inheritdoc />
public override void Write(Utf8JsonWriter writer, Guid value, JsonSerializerOptions options)
=> writer.WriteStringValue(value);
{
if (value == Guid.Empty)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(value);
}
}
}
}