Enable nullable reference types for MediaBrowser.Common

This commit is contained in:
Bond_009
2021-05-05 12:57:01 +02:00
parent 48e81e65e8
commit 91c2a57b28
43 changed files with 78 additions and 64 deletions

View File

@@ -19,10 +19,10 @@ namespace MediaBrowser.Common.Json.Converters
}
/// <inheritdoc />
public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options)
public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options)
{
var structType = typeToConvert.GetElementType() ?? typeToConvert.GenericTypeArguments[0];
return (JsonConverter)Activator.CreateInstance(typeof(JsonCommaDelimitedArrayConverter<>).MakeGenericType(structType));
return (JsonConverter?)Activator.CreateInstance(typeof(JsonCommaDelimitedArrayConverter<>).MakeGenericType(structType));
}
}
}