From dd30a389a065c122cae06920dd92dff373fe26fd Mon Sep 17 00:00:00 2001 From: Daniel Parks Date: Wed, 26 Apr 2023 21:41:10 -0500 Subject: [PATCH] TAStudio/PatternsForm: Block deletion of loop entry which would cause a crash --- src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs index 6e83cfed88..ec854b8d56 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/PatternsForm.cs @@ -88,6 +88,10 @@ namespace BizHawk.Client.EmuHawk private void DeleteButton_Click(object sender, EventArgs e) { + if (PatternList.SelectedIndex >= _counts.Count) + { + return; + } _counts.RemoveAt(PatternList.SelectedIndex); _values.RemoveAt(PatternList.SelectedIndex); UpdatePattern();