allow JsonGuidConverter to read null

This commit is contained in:
hawken 2020-11-28 09:14:58 +01:00
parent f1b3811ca7
commit f9f0df88d5
1 changed files with 5 additions and 1 deletions

View File

@ -11,7 +11,11 @@ namespace MediaBrowser.Common.Json.Converters
{
/// <inheritdoc />
public override Guid Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
=> new Guid(reader.GetString());
{
var guidStr = reader.GetString();
return guidStr == null ? Guid.Empty : new Guid(guidStr);
}
/// <inheritdoc />
public override void Write(Utf8JsonWriter writer, Guid value, JsonSerializerOptions options)