From 178509eb21c90eb4f183515ba3ee8076eee0fbd1 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Wed, 25 Nov 2020 11:52:02 +0100 Subject: [PATCH] Avoid loading assemblies in IPC when no plugins are active Apart from small optimization, this avoids the problem of starting IPC server if one of the assemblies fail to load (as ASF will abort the rest of the plugins loading routine, and therefore no plugins will be loaded at all). --- ArchiSteamFarm/IPC/Startup.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ArchiSteamFarm/IPC/Startup.cs b/ArchiSteamFarm/IPC/Startup.cs index b3ff2cbf6..3748017e1 100644 --- a/ArchiSteamFarm/IPC/Startup.cs +++ b/ArchiSteamFarm/IPC/Startup.cs @@ -248,11 +248,13 @@ namespace ArchiSteamFarm.IPC { #endif // Add support for controllers declared in custom plugins - HashSet? assemblies = PluginsCore.LoadAssemblies(); + if (PluginsCore.ActivePlugins?.Count > 0) { + HashSet? assemblies = PluginsCore.LoadAssemblies(); - if (assemblies != null) { - foreach (Assembly assembly in assemblies) { - mvc.AddApplicationPart(assembly); + if (assemblies != null) { + foreach (Assembly assembly in assemblies) { + mvc.AddApplicationPart(assembly); + } } }