aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Json/Converters/JsonNullableInt32Converter.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-08-25 07:33:58 -0600
committercrobibero <cody@robibe.ro>2020-08-25 07:33:58 -0600
commit5f64ab02a01f35f2bc2429cdee56973e77048fa5 (patch)
treead2869aca2126761b9d7dc93f068e7bc7562e9f1 /MediaBrowser.Common/Json/Converters/JsonNullableInt32Converter.cs
parent25be1a9b20a09979146c382b0a5c2325bf3ba21f (diff)
bump System.Text.Json
Diffstat (limited to 'MediaBrowser.Common/Json/Converters/JsonNullableInt32Converter.cs')
-rw-r--r--MediaBrowser.Common/Json/Converters/JsonNullableInt32Converter.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/MediaBrowser.Common/Json/Converters/JsonNullableInt32Converter.cs b/MediaBrowser.Common/Json/Converters/JsonNullableInt32Converter.cs
index c1660fe76..9db44d626 100644
--- a/MediaBrowser.Common/Json/Converters/JsonNullableInt32Converter.cs
+++ b/MediaBrowser.Common/Json/Converters/JsonNullableInt32Converter.cs
@@ -14,6 +14,11 @@ namespace MediaBrowser.Common.Json.Converters
/// <inheritdoc />
public override int? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
+ if (reader.TokenType == JsonTokenType.Null)
+ {
+ return null;
+ }
+
if (reader.TokenType == JsonTokenType.String)
{
ReadOnlySpan<byte> span = reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan;