diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2020-11-24 09:04:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-24 09:04:47 +0100 |
| commit | 4ce9bf3fcfa558e69dd5b0341c41408abdba762d (patch) | |
| tree | 4fc64afe05d26d0f5534eb70d088d00673fd13c2 /MediaBrowser.Common | |
| parent | 50e375020a580078ed309e2d59cf124d10b4a2ed (diff) | |
| parent | c4925ad70bd84477bd1e8df59de3db1196432fc2 (diff) | |
Merge pull request #4568 from crobibero/guid-empty
Serialize Guid.Empty to null
Diffstat (limited to 'MediaBrowser.Common')
| -rw-r--r-- | MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs b/MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs index d35a761f3..54325a02b 100644 --- a/MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs +++ b/MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs @@ -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); + } + } } } |
