diff options
| author | theguymadmax <theguymadmax@proton.me> | 2026-02-03 01:16:25 -0500 |
|---|---|---|
| committer | theguymadmax <theguymadmax@proton.me> | 2026-02-03 01:16:25 -0500 |
| commit | 613d72fa26375b29b6c5da7933feff8ace1ac54e (patch) | |
| tree | 5518383bdd2f7e0c6628146f86462deeed17a12f | |
| parent | 909e2142d6bb4833bccb84a50360cae7f91e2fd3 (diff) | |
Skip empty ViewType validation
| -rw-r--r-- | Jellyfin.Api/Controllers/DisplayPreferencesController.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/DisplayPreferencesController.cs b/Jellyfin.Api/Controllers/DisplayPreferencesController.cs index 585318d24..ef54e9db5 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<ViewType>(displayPreferences.CustomPrefs[key], true, out _)) + var viewType = displayPreferences.CustomPrefs[key]; + + if (string.IsNullOrEmpty(viewType)) + { + displayPreferences.CustomPrefs.Remove(key); + continue; + } + + if (!Enum.TryParse<ViewType>(viewType, true, out _)) { - _logger.LogError("Invalid ViewType: {LandingScreenOption}", displayPreferences.CustomPrefs[key]); + _logger.LogError("Invalid ViewType: {LandingScreenOption}", viewType); displayPreferences.CustomPrefs.Remove(key); } } |
