From cf67381e310789f5c2f594b51c6170cf7e9019d0 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Tue, 8 Nov 2022 21:13:57 +0100 Subject: Fix release build --- Jellyfin.Api/Controllers/ImageController.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Jellyfin.Api/Controllers/ImageController.cs') diff --git a/Jellyfin.Api/Controllers/ImageController.cs b/Jellyfin.Api/Controllers/ImageController.cs index 260b9536e..49342ad5c 100644 --- a/Jellyfin.Api/Controllers/ImageController.cs +++ b/Jellyfin.Api/Controllers/ImageController.cs @@ -28,6 +28,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; namespace Jellyfin.Api.Controllers @@ -2026,8 +2027,13 @@ namespace Jellyfin.Api.Controllers } var acceptParam = Request.Query[HeaderNames.Accept]; + if (StringValues.IsNullOrEmpty(acceptParam)) + { + return Array.Empty(); + } - var supportsWebP = SupportsFormat(supportedFormats, acceptParam, ImageFormat.Webp, false); + // Can't be null, checked above + var supportsWebP = SupportsFormat(supportedFormats, acceptParam!, ImageFormat.Webp, false); if (!supportsWebP) { @@ -2049,7 +2055,8 @@ namespace Jellyfin.Api.Controllers formats.Add(ImageFormat.Jpg); formats.Add(ImageFormat.Png); - if (SupportsFormat(supportedFormats, acceptParam, ImageFormat.Gif, true)) + // Can't be null, checked above + if (SupportsFormat(supportedFormats, acceptParam!, ImageFormat.Gif, true)) { formats.Add(ImageFormat.Gif); } -- cgit v1.2.3