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).
This commit is contained in:
JustArchi
2020-11-25 11:52:02 +01:00
parent 2d6e8ed673
commit 178509eb21

View File

@@ -248,11 +248,13 @@ namespace ArchiSteamFarm.IPC {
#endif
// Add support for controllers declared in custom plugins
HashSet<Assembly>? assemblies = PluginsCore.LoadAssemblies();
if (PluginsCore.ActivePlugins?.Count > 0) {
HashSet<Assembly>? 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);
}
}
}