Skip to content

Commit

Permalink
bugstomping
Browse files Browse the repository at this point in the history
  • Loading branch information
politas committed Nov 8, 2017
1 parent 86a0766 commit 6f71d5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cmdline/Action/Replace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public int RunCommand(CKAN.KSP ksp, object raw_options)
try
{
// Check if replacement is available
ModuleReplacement replacement = registry.GetReplacement(mod.Key, ksp.VersionCriteria());
ModuleReplacement replacement = registry.GetReplacement(mod, ksp.VersionCriteria());
if (replacement != null)
{
// Replaceable
Expand Down
8 changes: 4 additions & 4 deletions Core/Registry/IRegistryQuerier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ public static ModuleReplacement GetReplacement( this IRegistryQuerier querier, s
}
catch (ModuleNotFoundKraken)
{
return false;
return null;
}
if (installedVersion == null) return false; // Mod is not installed, so we don't care about replacements
if (installedVersion == null) return null; // Mod is not installed, so we don't care about replacements
//get the identifier from the replaced_by relationship, if it exists
RelationshipDescriptor replacedBy = installedVersion.replaced_by;
if (installedVersion.replaced_by == null) return false; // No replaced_by relationship
if (installedVersion.replaced_by == null) return null; // No replaced_by relationship
// Now we need to see if there is a compatible version of the replacement
try
{
Expand All @@ -195,7 +195,7 @@ public static ModuleReplacement GetReplacement( this IRegistryQuerier querier, s
}
else
{
replacement.ReplaceWith = querier.LatestAvailable(installedVersion.replaced_by.name, versionCriteria);
replacement.ReplaceWith = querier.LatestAvailable(installedVersion.replaced_by.name, version);
if (replacement.ReplaceWith != null)
{
if (installedVersion.replaced_by.min_version != null)
Expand Down

0 comments on commit 6f71d5d

Please sign in to comment.