jessaskey/mhedit

Clicking in an empty maze will cause an OutOfRangeException.

bakerhillpins opened this issue · 1 comments

System.ArgumentOutOfRangeException
HResult=0x80131502
Message=InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
at mhedit.MazeController.RefreshMaze() in C:\Users\Public\Local Storage\MajorHavocEditTesting\mhedit\MazeController.cs:line 1139
at mhedit.MazeController.OnMouseClick(MouseEventArgs e) in C:\Users\Public\Local Storage\MajorHavocEditTesting\mhedit\MazeController.cs:line 658
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

This was an issue with setting the selected index to a value when the collection was empty. I searched for similar code elsewhere and it looks like this was the only place.