Plugins: Fail gracefully on multiple instances of same plugin

This commit is contained in:
Katy Coe
2020-12-27 23:59:41 +01:00
parent 4901d9b4bc
commit a32a68b02f
3 changed files with 24 additions and 6 deletions

View File

@@ -126,7 +126,12 @@ namespace Il2CppInspectorGUI
catch (NotSupportedException) { }
// Load plugins if they aren't already
PluginManager.EnsureInit();
try {
PluginManager.EnsureInit();
} catch (InvalidOperationException ex) {
MessageBox.Show(ex.Message, "Fatal error loading plugins");
Environment.Exit(1);
}
// Arrange plugins
var loadedPlugins = PluginManager.AsInstance.ManagedPlugins;