pm: don't throw if there are no valid versions for a plugin

This commit is contained in:
goaaats 2024-03-20 23:28:14 +01:00
parent 0382b927ea
commit 714e9e0319

View file

@ -470,10 +470,18 @@ internal partial class PluginManager : IInternalDisposableService
try try
{ {
var dllFile = new FileInfo(Path.Combine(versionDir.FullName, $"{pluginDir.Name}.dll")); var dllFile = new FileInfo(Path.Combine(versionDir.FullName, $"{pluginDir.Name}.dll"));
var manifestFile = LocalPluginManifest.GetManifestFile(dllFile); if (!dllFile.Exists)
{
if (!manifestFile.Exists) Log.Error("No DLL found for plugin at {Path}", versionDir.FullName);
continue; continue;
}
var manifestFile = LocalPluginManifest.GetManifestFile(dllFile);
if (!manifestFile.Exists)
{
Log.Error("No manifest for plugin at {Path}", dllFile.FullName);
continue;
}
var manifest = LocalPluginManifest.Load(manifestFile); var manifest = LocalPluginManifest.Load(manifestFile);
if (manifest == null) if (manifest == null)
@ -494,6 +502,12 @@ internal partial class PluginManager : IInternalDisposableService
} }
this.configuration.QueueSave(); this.configuration.QueueSave();
if (versionsDefs.Count == 0)
{
Log.Verbose("No versions found for plugin: {Name}", pluginDir.Name);
continue;
}
try try
{ {