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

@@ -1,3 +1,4 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.Net.Mime;
using System.Text.Json;
@@ -94,6 +95,11 @@ namespace Jellyfin.Api.Controllers
{
var configurationType = _configurationManager.GetConfigurationType(key);
var configuration = await JsonSerializer.DeserializeAsync(Request.Body, configurationType, _serializerOptions).ConfigureAwait(false);
if (configuration == null)
{
throw new ArgumentException("Body doesn't contain a valid configuration");
}
_configurationManager.SaveConfiguration(key, configuration);
return NoContent();
}