From d06ddc04e1458fafd445b97b540d774287bce450 Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 24 Apr 2020 16:41:08 -0500 Subject: [PATCH] InputRoll - only attempt to remove selected items beyond rowcount if there are selected items past that count, this may fix the underlying issue in #1822 --- .../CustomControls/InputRoll/InputRoll.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs index 6f1ed73f4e..402b124853 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs @@ -269,7 +269,12 @@ namespace BizHawk.Client.EmuHawk } _rowCount = value; - _selectedItems.RemoveWhere(i => i.RowIndex >= _rowCount); + + if (_selectedItems.Max(s => s.RowIndex) >= _rowCount) + { + _selectedItems.RemoveWhere(i => i.RowIndex >= _rowCount); + } + RecalculateScrollBars(); }