From 4ba4eefeeb145d03c1599c12a1ef61b4f87f67fb Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Wed, 23 Dec 2020 10:26:02 +0000 Subject: [PATCH] Update Emby.Server.Implementations/Plugins/PluginManager.cs Co-authored-by: Claus Vium --- Emby.Server.Implementations/Plugins/PluginManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Emby.Server.Implementations/Plugins/PluginManager.cs b/Emby.Server.Implementations/Plugins/PluginManager.cs index fbb092a7c6..2609f6fca6 100644 --- a/Emby.Server.Implementations/Plugins/PluginManager.cs +++ b/Emby.Server.Implementations/Plugins/PluginManager.cs @@ -232,9 +232,9 @@ namespace Emby.Server.Implementations.Plugins var plugins = _plugins.Where(p => p.Id.Equals(id)); plugin = plugins.FirstOrDefault(p => p.Instance != null); - if (plugin == null) + if (plugin == null && plugins.Length > 0) { - plugin = plugins.OrderByDescending(p => p.Version).FirstOrDefault(); + plugin = plugins.OrderByDescending(p => p.Version)[0]; } } else