From 5966ee6d87cf4abbe6cf327286788e7e03fe0592 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Sun, 5 Apr 2020 12:07:43 -0400 Subject: Convert type checks and null checks into pattern matching --- MediaBrowser.Api/PluginService.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'MediaBrowser.Api/PluginService.cs') 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(); } -- cgit v1.2.3