Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash on startup (fixes #2134) #2138

Merged
merged 2 commits into from Oct 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion Core/Registry/Registry.cs
Expand Up @@ -529,7 +529,9 @@ public List<CkanModule> AllAvailable(string module)
/// <param name="identifier">Name of mod to check</param>
public KspVersion LatestCompatibleKSP(string identifier)
{
return available_modules[identifier].LatestCompatibleKSP();
return available_modules.ContainsKey(identifier)
? available_modules[identifier].LatestCompatibleKSP()
: null;
}


Expand Down
2 changes: 1 addition & 1 deletion GUI/GUIMod.cs
Expand Up @@ -95,7 +95,7 @@ public GUIMod(CkanModule mod, IRegistryQuerier registry, KspVersionCriteria curr
// KSP.
if (latestAvailableForAnyVersion != null)
{
KSPCompatibility = KSPCompatibilityLong = registry.LatestCompatibleKSP(mod.identifier)?.ToString() ?? "";
KSPCompatibility = KSPCompatibilityLong = registry.LatestCompatibleKSP(mod.identifier)?.ToString() ?? mod.LatestCompatibleKSP().ToString();

// If the mod we have installed is *not* the mod we have installed, or we don't know
// what we have installed, indicate that an upgrade would be needed.
Expand Down