From 5b119828725ef43354405a50643e3c052dcc8250 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Thu, 19 Sep 2024 09:12:57 -0700 Subject: [PATCH] Fix LT-21890: Deleting from right side of affix process rule crashes --- Src/LexText/Morphology/AffixRuleFormulaControl.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/LexText/Morphology/AffixRuleFormulaControl.cs b/Src/LexText/Morphology/AffixRuleFormulaControl.cs index 95aff26db3..5cb652df97 100644 --- a/Src/LexText/Morphology/AffixRuleFormulaControl.cs +++ b/Src/LexText/Morphology/AffixRuleFormulaControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2015 SIL International +// Copyright (c) 2015 SIL International // This software is licensed under the LGPL, version 2.1 or later // (http://www.gnu.org/licenses/lgpl-2.1.html) @@ -716,7 +716,7 @@ protected bool RemoveFromOutput(bool forward, SelectionHelper sel, out int index else { int idx = GetIndexToRemove(mappings, sel, forward); - if (idx > -1) + if (idx > -1 && idx < mappings.Count()) { var mapping = (IMoRuleMapping) mappings[idx]; index = idx - 1;