From 613d72fa26375b29b6c5da7933feff8ace1ac54e Mon Sep 17 00:00:00 2001 From: theguymadmax Date: Tue, 3 Feb 2026 01:16:25 -0500 Subject: [PATCH] Skip empty ViewType validation --- .../Controllers/DisplayPreferencesController.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Jellyfin.Api/Controllers/DisplayPreferencesController.cs b/Jellyfin.Api/Controllers/DisplayPreferencesController.cs index 585318d245..ef54e9db54 100644 --- a/Jellyfin.Api/Controllers/DisplayPreferencesController.cs +++ b/Jellyfin.Api/Controllers/DisplayPreferencesController.cs @@ -191,9 +191,17 @@ public class DisplayPreferencesController : BaseJellyfinApiController foreach (var key in displayPreferences.CustomPrefs.Keys.Where(key => key.StartsWith("landing-", StringComparison.OrdinalIgnoreCase))) { - if (!Enum.TryParse(displayPreferences.CustomPrefs[key], true, out _)) + var viewType = displayPreferences.CustomPrefs[key]; + + if (string.IsNullOrEmpty(viewType)) { - _logger.LogError("Invalid ViewType: {LandingScreenOption}", displayPreferences.CustomPrefs[key]); + displayPreferences.CustomPrefs.Remove(key); + continue; + } + + if (!Enum.TryParse(viewType, true, out _)) + { + _logger.LogError("Invalid ViewType: {LandingScreenOption}", viewType); displayPreferences.CustomPrefs.Remove(key); } }