diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-11-28 16:23:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-28 16:23:56 +0100 |
| commit | 1cd3b3fc41870cc345fcbf5a59f2309c3760b2e3 (patch) | |
| tree | 87369e393d14c5429a7b6f934db4a6d20c16ce4a | |
| parent | cab78f40b3018e52234c2b1b871889866e3134b2 (diff) | |
| parent | f9f0df88d5aa0aa8bc58cefb05960662057daa21 (diff) | |
Merge pull request #4605 from hawken93/bugfix-libraryerror
Allow JsonGuidConverter to read null
| -rw-r--r-- | MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs b/MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs index 54325a02b..52e08d071 100644 --- a/MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs +++ b/MediaBrowser.Common/Json/Converters/JsonGuidConverter.cs @@ -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) |
