Update Emby.Server.Implementations/Plugins/PluginManager.cs

Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
This commit is contained in:
BaronGreenback 2020-12-23 10:26:02 +00:00 committed by GitHub
parent 66d98cb8e4
commit 4ba4eefeeb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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