From a44af7bcd8d0171de2af4417003b1485a95ac54a Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Thu, 6 Feb 2020 10:28:43 -0600 Subject: [PATCH] Fix ArgumentException in ConsoleUI recommendations --- Core/ModuleInstaller.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Core/ModuleInstaller.cs b/Core/ModuleInstaller.cs index 40d517eff3..80e55420bf 100644 --- a/Core/ModuleInstaller.cs +++ b/Core/ModuleInstaller.cs @@ -1304,7 +1304,9 @@ out Dictionary> supporters var candidates = registry.CompatibleModules(ksp.VersionCriteria()) .Where(mod => !registry.IsInstalled(mod.identifier) && !toInstall.Any(m => m.identifier == mod.identifier)) - .Where(m => m?.supports != null); + .Where(m => m?.supports != null) + .Except(recommendations.Keys) + .Except(suggestions.Keys); // Find each module that "supports" something we're installing foreach (CkanModule mod in candidates) { @@ -1361,8 +1363,7 @@ HashSet toExclude if (!registry.IsInstalled(provider.identifier) && !toExclude.Any(m => m.identifier == provider.identifier)) { - List dependers; - if (dependersIndex.TryGetValue(provider, out dependers)) + if (dependersIndex.TryGetValue(provider, out List dependers)) { // Add the dependent mod to the list of reasons this dependency is shown. dependers.Add(mod.identifier);