diff --git a/Jellyfin.Api/Controllers/DashboardController.cs b/Jellyfin.Api/Controllers/DashboardController.cs index 6a7bf7d0aa..21c320a490 100644 --- a/Jellyfin.Api/Controllers/DashboardController.cs +++ b/Jellyfin.Api/Controllers/DashboardController.cs @@ -86,7 +86,7 @@ namespace Jellyfin.Api.Controllers configPages.AddRange(_appHost.Plugins.SelectMany(GetConfigPages)); - if (pageType != null) + if (pageType.HasValue) { configPages = configPages.Where(p => p.ConfigurationPageType == pageType).ToList(); } @@ -246,14 +246,12 @@ namespace Jellyfin.Api.Controllers private IEnumerable> GetPluginPages(IPlugin plugin) { - var hasConfig = plugin as IHasWebPages; - - if (hasConfig == null) + if (!(plugin is IHasWebPages)) { return new List>(); } - return hasConfig.GetPages().Select(i => new Tuple(i, plugin)); + return (plugin as IHasWebPages)!.GetPages().Select(i => new Tuple(i, plugin)); } private IEnumerable> GetPluginPages()