Skip to content

Commit

Permalink
Merge #1436: Fix CastException when installing from .ckan
Browse files Browse the repository at this point in the history
* Postremus/install_ckan_crash_fix:
  Fix a castexception when installing metapackage The install logic still  used a KeyValuePair<GuiMod, GuiModChangeTyp> while everything else uses ModChange object's now
  • Loading branch information
pjf committed Sep 7, 2015
2 parents 9ef4024 + 5edfbe6 commit d074fc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
### Bugfixes

- [GUI] Re-ordering repositories in the settings panel is more stable. (Postremus, #1431)
- [GUI] Fixed an unhandled exception that could occur when installing metapages via `Install -> From .ckan`. (Postremus, #1436)
- [Core] Less likely to remove essential directories (such as `Ships/*`) if empty. (Postremus, #1405)

### Features
Expand Down
9 changes: 5 additions & 4 deletions GUI/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -909,17 +909,18 @@ private void installFromckanToolStripMenuItem_Click(object sender, EventArgs e)
// Sneakily add our version in...
registry_manager.registry.AddAvailable(module);

var changeset = new List<KeyValuePair<GUIMod, GUIModChangeType>>();
changeset.Add(new KeyValuePair<GUIMod, GUIModChangeType>(
new GUIMod(module,registry_manager.registry,CurrentInstance.Version()), GUIModChangeType.Install));
var changeset = new List<ModChange>();
changeset.Add(new ModChange(
new GUIMod(module,registry_manager.registry,CurrentInstance.Version()),
GUIModChangeType.Install, null));

menuStrip1.Enabled = false;

RelationshipResolverOptions install_ops = RelationshipResolver.DefaultOpts();
install_ops.with_recommends = false;

m_InstallWorker.RunWorkerAsync(
new KeyValuePair<List<KeyValuePair<GUIMod, GUIModChangeType>>, RelationshipResolverOptions>(
new KeyValuePair<List<ModChange>, RelationshipResolverOptions>(
changeset, install_ops));
m_Changeset = null;

Expand Down

0 comments on commit d074fc9

Please sign in to comment.