Skip to content

Commit 8ede45a

Browse files
committed
Kill bug
1 parent 6d7d950 commit 8ede45a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

RetailCoder.VBE/UI/Settings/TodoListSettingsUserControl.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public partial class TodoListSettingsUserControl : UserControl, ITodoSettingsVie
1414
private GridViewSort<ToDoMarker> _gridViewSort;
1515

1616
/// <summary> Parameterless Constructor is to enable design view only. DO NOT USE. </summary>
17-
/// <param name="markers"></param>
1817
public TodoListSettingsUserControl()
1918
{
2019
InitializeComponent();
@@ -79,7 +78,13 @@ private void SortColumn(object sender, DataGridViewCellMouseEventArgs e)
7978
public int SelectedIndex
8079
{
8180
get { return TodoMarkersGridView.SelectedRows[0].Index; }
82-
set { TodoMarkersGridView.Rows[value].Selected = true; }
81+
set
82+
{
83+
if (TodoMarkersGridView.Rows.Count > 0)
84+
{
85+
TodoMarkersGridView.Rows[value].Selected = true;
86+
}
87+
}
8388
}
8489

8590
public TodoPriority ActiveMarkerPriority
@@ -125,7 +130,7 @@ private void RaiseEvent(object sender, EventArgs e, EventHandler handler)
125130
{
126131
if (handler != null)
127132
{
128-
handler(this, e);
133+
handler(sender, e);
129134
}
130135
}
131136
}

0 commit comments

Comments
 (0)