Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

Commit

Permalink
check reasons for mod to prevent a spuriour ArgumentException (KSP-CK…
Browse files Browse the repository at this point in the history
  • Loading branch information
ayan4m1 committed Oct 2, 2016
1 parent 97c4bfe commit 1c7852a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Core/Relationships/RelationshipResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ public bool IsConsistent
public string ReasonStringFor(CkanModule mod)
{
var reason = ReasonFor(mod);
var is_root_type = reason.GetType() == typeof (SelectionReason.UserRequested)
var is_root_type = reason.GetType() == typeof(SelectionReason.UserRequested)
|| reason.GetType() == typeof(SelectionReason.Installed);
return is_root_type
? reason.Reason
Expand All @@ -527,7 +527,7 @@ public string ReasonStringFor(CkanModule mod)
public SelectionReason ReasonFor(CkanModule mod)
{
if (mod == null) throw new ArgumentNullException();
if (!ModList().Contains(mod))
if (!reasons.ContainsKey(mod) && !ModList().Contains(mod))
{
throw new ArgumentException("Mod " + mod.identifier + " is not in the list");
}
Expand Down

0 comments on commit 1c7852a

Please sign in to comment.