diff options
Diffstat (limited to 'MediaBrowser.Common/Json/Converters/JsonNullableInt64Converter.cs')
| -rw-r--r-- | MediaBrowser.Common/Json/Converters/JsonNullableInt64Converter.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/MediaBrowser.Common/Json/Converters/JsonNullableInt64Converter.cs b/MediaBrowser.Common/Json/Converters/JsonNullableInt64Converter.cs index 53e5f6e9d..a9cdc23d7 100644 --- a/MediaBrowser.Common/Json/Converters/JsonNullableInt64Converter.cs +++ b/MediaBrowser.Common/Json/Converters/JsonNullableInt64Converter.cs @@ -21,6 +21,11 @@ namespace MediaBrowser.Common.Json.Converters /// <returns>Parsed value.</returns> public override long? Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + { + return null; + } + if (reader.TokenType == JsonTokenType.String) { // try to parse number directly from bytes |
