diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2020-12-08 18:22:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-08 18:22:18 +0100 |
| commit | b6ecaccf92ae9ca9b0cc75e6dd666a896e72aa99 (patch) | |
| tree | e6facbd6789b2099bfc5800604fa5bce6ca3f900 /MediaBrowser.Common/Json | |
| parent | 94d805d03d93764365c5b63e23f239d47d23ad0a (diff) | |
| parent | 8517b28eba8c96f8b695a8137c7f9f0d22212400 (diff) | |
Merge pull request #4730 from crobibero/base-item-dto-guid-nullable
Don't serialize empty GUID to null
Diffstat (limited to 'MediaBrowser.Common/Json')
| -rw-r--r-- | MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs b/MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs index 52e08d071a..ccf214e3ca 100644 --- a/MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs +++ b/MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs @@ -13,21 +13,13 @@ namespace MediaBrowser.Common.Json.Converters public override Guid Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { var guidStr = reader.GetString(); - return guidStr == null ? Guid.Empty : new Guid(guidStr); } /// <inheritdoc /> public override void Write(Utf8JsonWriter writer, Guid value, JsonSerializerOptions options) { - if (value == Guid.Empty) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(value); - } + writer.WriteStringValue(value); } } } |
