aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/PluginService.cs
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2020-04-05 12:07:43 -0400
committerPatrick Barron <barronpm@gmail.com>2020-04-05 12:07:43 -0400
commit5966ee6d87cf4abbe6cf327286788e7e03fe0592 (patch)
treeadec5ad43f5a65616701039fdb2b2de89613cf54 /MediaBrowser.Api/PluginService.cs
parent29539174a3de47c151cc7c7fd192100e6fbe48d7 (diff)
Convert type checks and null checks into pattern matching
Diffstat (limited to 'MediaBrowser.Api/PluginService.cs')
-rw-r--r--MediaBrowser.Api/PluginService.cs4
1 files changed, 1 insertions, 3 deletions
diff --git a/MediaBrowser.Api/PluginService.cs b/MediaBrowser.Api/PluginService.cs
index 16d3268b9..7f74511ee 100644
--- a/MediaBrowser.Api/PluginService.cs
+++ b/MediaBrowser.Api/PluginService.cs
@@ -243,9 +243,7 @@ namespace MediaBrowser.Api
// https://code.google.com/p/servicestack/source/browse/trunk/Common/ServiceStack.Text/ServiceStack.Text/Controller/PathInfo.cs
var id = Guid.Parse(GetPathValue(1));
- var plugin = _appHost.Plugins.First(p => p.Id == id) as IHasPluginConfiguration;
-
- if (plugin == null)
+ if (!(_appHost.Plugins.First(p => p.Id == id) is IHasPluginConfiguration plugin))
{
throw new FileNotFoundException();
}