aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Plugins/PluginManager.cs
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2022-10-07 09:57:16 +0200
committerGitHub <noreply@github.com>2022-10-07 09:57:16 +0200
commit81b04ddbb54201d2e07310e3c700cca8a94d8955 (patch)
treea4e9aeb70e35b3e47a7d8af17b328e88a1c77ed0 /Emby.Server.Implementations/Plugins/PluginManager.cs
parent6bf71c0fd355e9c95a1e142019d9bc5cce34200d (diff)
parent14027f962ce074623fd89967ca9565bbeb785066 (diff)
Merge branch 'master' into providermanager-cleanup
Diffstat (limited to 'Emby.Server.Implementations/Plugins/PluginManager.cs')
-rw-r--r--Emby.Server.Implementations/Plugins/PluginManager.cs20
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)