mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-14 20:54:58 -04:00
Fixed: Unexpected languages stored in DB will be treated as Unknown
Closes #8482
This commit is contained in:
@@ -34,8 +34,15 @@ namespace NzbDrone.Core.Datastore.Converters
|
||||
|
||||
public class LanguageIntConverter : JsonConverter<Language>
|
||||
{
|
||||
public override bool HandleNull => true;
|
||||
|
||||
public override Language Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
if (reader.TokenType == JsonTokenType.Null)
|
||||
{
|
||||
return Language.Unknown;
|
||||
}
|
||||
|
||||
var item = reader.GetInt32();
|
||||
return (Language)item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user