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

[Bug] Crash when trying to "Add available updates" with empty mod list. #3078

Closed
Artemonim opened this issue Jun 14, 2020 · 4 comments · Fixed by #3079
Closed

[Bug] Crash when trying to "Add available updates" with empty mod list. #3078

Artemonim opened this issue Jun 14, 2020 · 4 comments · Fixed by #3079
Labels
Bug Something is not working as intended GUI Issues affecting the interactive GUI

Comments

@Artemonim
Copy link

Artemonim commented Jun 14, 2020

Background

  • Operating System: Win10 Pro
  • CKAN Version: 1.27.2
  • KSP Version: 1.9.1.2788

Have you made any manual changes to your GameData folder (i.e., not via CKAN)?
Yes, but not with this mod.

Problem

If you filter the list of modifications by "Newly compatible" and the resulting list does not contain all the mods available for updating, CKAN will crash when you try to "Add available updates".

Steps to reproduce

  • Switch the list filter to "Newly compatible"
  • Make sure that the "Add available updates" button is active, but the list of modifications is empty.
  • Click the "Add available updates" button.
  • Unhandled exception in the application

CKAN error code (occurs after restarting the program):

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.Collections.ArrayList.get_Item (System.Int32 index) [0x0000d] in <a5e6a8b38be74ec1b9abd482cb076c8a>:0 
  at System.Windows.Forms.DataGridViewRowCollection.get_Item (System.Int32 index) [0x00000] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at CKAN.ManageMods.MarkAllUpdates () [0x000fb] in <1e9e6cc7a1124c26a7e978a1dd44c3d6>:0 
  at CKAN.ManageMods.MarkAllUpdatesToolButton_Click (System.Object sender, System.EventArgs e) [0x00001] in <1e9e6cc7a1124c26a7e978a1dd44c3d6>:0 
  at System.Windows.Forms.ToolStripItem.OnClick (System.EventArgs e) [0x00019] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at System.Windows.Forms.ToolStripMenuItem.OnClick (System.EventArgs e) [0x00090] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at System.Windows.Forms.ToolStripMenuItem.HandleClick (System.Int32 mouse_clicks, System.EventArgs e) [0x00000] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at System.Windows.Forms.ToolStripItem.FireEvent (System.EventArgs e, System.Windows.Forms.ToolStripItemEventType met) [0x00054] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.ToolStripItem.FireEvent(System.EventArgs,System.Windows.Forms.ToolStripItemEventType)
  at System.Windows.Forms.ToolStrip.OnMouseUp (System.Windows.Forms.MouseEventArgs mea) [0x00048] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x00078] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x001b4] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at System.Windows.Forms.ToolStrip.WndProc (System.Windows.Forms.Message& m) [0x00000] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at System.Windows.Forms.MenuStrip.WndProc (System.Windows.Forms.Message& m) [0x00000] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x0000b] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
  at System.Windows.Forms.NativeWindow.WndProc (System.IntPtr hWnd, System.Windows.Forms.Msg msg, System.IntPtr wParam, System.IntPtr lParam) [0x00085] in <5e01e3d59bfc48e1a1ea0509bb585d97>:0 
exception inside UnhandledException handler: (null) assembly:/media/DataTrove/mono-dev/lib/mono/4.5/mscorlib.dll type:InvalidOperationException member:(null)
@Artemonim Artemonim changed the title [Bug] Crash when trying to "Add available updates" with the "Newly compatible" filter [Bug] Crash when trying to "Add available updates" with empty mod list. Jun 14, 2020
@Artemonim
Copy link
Author

Now I get an "Unable to load" error after every run of CKAN 0_o

@HebaruSan
Copy link
Member

I'm able to reproduce the initial crash (pasted in the actual exception), but it's fine after that.

@HebaruSan HebaruSan added Bug Something is not working as intended GUI Issues affecting the interactive GUI labels Jun 14, 2020
@HebaruSan
Copy link
Member

For me it crashes here:

// Select the top row and scroll the list to it.
ModGrid.CurrentCell = ModGrid.Rows[0].Cells[SelectableColumnIndex()];

... presumably because my grid is empty and so is ModGrid.Rows, so trying to access elements of it won't work.

@Artemonim, is the grid empty when you're trying this?

@Artemonim
Copy link
Author

screen capture.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants