diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2022-10-07 07:50:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-07 07:50:39 +0200 |
| commit | 719e5eae16a3488de449a5b2a7c56132c8f1e5c1 (patch) | |
| tree | 0eb900ce94fb549433274522424dda8617386f4b /Emby.Server.Implementations/Plugins/PluginManager.cs | |
| parent | 9ff918cb142f837bd55e1f87aba3f68f7de295e4 (diff) | |
| parent | f5613add1af9e789a7c16f6f631cccd329d5841a (diff) | |
Merge pull request #8503 from Bond-009/ThrowIfNull
Diffstat (limited to 'Emby.Server.Implementations/Plugins/PluginManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Plugins/PluginManager.cs | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/Emby.Server.Implementations/Plugins/PluginManager.cs b/Emby.Server.Implementations/Plugins/PluginManager.cs index 45ef36441..ec4e0dbeb 100644 --- a/Emby.Server.Implementations/Plugins/PluginManager.cs +++ b/Emby.Server.Implementations/Plugins/PluginManager.cs @@ -234,10 +234,7 @@ namespace Emby.Server.Implementations.Plugins /// <returns>Outcome of the operation.</returns> public bool RemovePlugin(LocalPlugin plugin) { - if (plugin == null) - { - throw new ArgumentNullException(nameof(plugin)); - } + ArgumentNullException.ThrowIfNull(plugin); if (DeletePlugin(plugin)) { @@ -288,10 +285,7 @@ namespace Emby.Server.Implementations.Plugins /// <param name="plugin">The <see cref="LocalPlugin"/> of the plug to disable.</param> public void EnablePlugin(LocalPlugin plugin) { - if (plugin == null) - { - throw new ArgumentNullException(nameof(plugin)); - } + ArgumentNullException.ThrowIfNull(plugin); if (ChangePluginState(plugin, PluginStatus.Active)) { @@ -306,10 +300,7 @@ namespace Emby.Server.Implementations.Plugins /// <param name="plugin">The <see cref="LocalPlugin"/> of the plug to disable.</param> public void DisablePlugin(LocalPlugin plugin) { - if (plugin == null) - { - throw new ArgumentNullException(nameof(plugin)); - } + ArgumentNullException.ThrowIfNull(plugin); // Update the manifest on disk if (ChangePluginState(plugin, PluginStatus.Disabled)) @@ -326,10 +317,7 @@ namespace Emby.Server.Implementations.Plugins public void FailPlugin(Assembly assembly) { // Only save if disabled. - if (assembly == null) - { - throw new ArgumentNullException(nameof(assembly)); - } + ArgumentNullException.ThrowIfNull(assembly); var plugin = _plugins.FirstOrDefault(p => p.DllFiles.Contains(assembly.Location)); if (plugin == null) |
