Skip to content

Commit

Permalink
Try to fix the missing default instance bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderDzhoganov committed Dec 16, 2014
1 parent 6215958 commit 40b41ce
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions CKAN/CKAN/KSPManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,17 @@ public KSP FindAndRegisterDefaultInstance()
/// </summary>
public KSP AddInstance(string name, string path)
{
var ksp = new KSP(path, User);
GetInstances().Add(name, ksp);
PopulateRegistryWithInstances();
return ksp;
try
{
var ksp = new KSP(path, User);
GetInstances().Add(name, ksp);
PopulateRegistryWithInstances();
return ksp;
}
catch (NotKSPDirKraken e)
{
return null;
}
}

/// <summary>
Expand Down

0 comments on commit 40b41ce

Please sign in to comment.