aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Plugins/PluginManager.cs
diff options
context:
space:
mode:
authorNegulici-R. Barnabas <109497789+negulici-r-barnabas@users.noreply.github.com>2022-11-13 15:29:16 +0200
committerGitHub <noreply@github.com>2022-11-13 15:29:16 +0200
commitb7aa5ed862db11bbbc0a4ea5c92a67b772bfc35d (patch)
treed8f396f581f3bdbd4be4c34d4a949df9fff72934 /Emby.Server.Implementations/Plugins/PluginManager.cs
parent1e41636e30b82518633ac6979564ff98bb40aca9 (diff)
parent6655cf4e58285f51b612efb0bb6229f036da2591 (diff)
Merge branch 'jellyfin:master' into master
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)