# HG changeset patch # User IBBoard # Date 1279136250 0 # Node ID e0e5af2a934cf7f9d71b3517345e38e5e8f48f32 # Parent d533f3b3ba1ef4b3b0f49c62b27615c8e73a7f71 Fixes #295: Index out of bounds when changing unit size and clicking in equipment list * Use the only fix that seems to work - unsubscribe and re-subscribe to the selection change so that we don't trigger it when setting an existing value diff -r d533f3b3ba1e -r e0e5af2a934c FrmUnit.cs --- a/FrmUnit.cs Mon Jul 05 20:08:39 2010 +0000 +++ b/FrmUnit.cs Wed Jul 14 19:37:30 2010 +0000 @@ -595,7 +595,10 @@ if (idx > -1) { + //HACK: Unsubscribe and resubscribe to prevent Index Out Of Bounds from selection changed event, as per ticket 295 + equipmentList.SelectedIndexChanged -= equipmentList_SelectedIndexChanged; equipmentList.Items[idx] = equipChoice; + equipmentList.SelectedIndexChanged += equipmentList_SelectedIndexChanged; } else {