Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LT-20588: Crash in Affix Process Rule #167

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Src/LexText/Morphology/AffixRuleFormulaControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private bool DisplayVariableOption(object option)
private bool DisplayColumnOption(object option)
{
SelectionHelper sel = SelectionHelper.Create(m_view);
if (sel.IsRange)
if (sel == null || sel.IsRange)
return false;

int cellId = GetCell(sel);
Expand Down
8 changes: 7 additions & 1 deletion Src/LexText/Morphology/RuleFormulaControl.cs
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -569,6 +569,12 @@ private void m_insertionControl_Insert(object sender, InsertEventArgs e)
var redo = string.Format(MEStrings.ksRuleRedoInsert, option);

SelectionHelper sel = SelectionHelper.Create(m_view);
if (sel == null)
{
// The selection can become invalid because of an undo (see LT-20588).
m_insertionControl.UpdateOptionsDisplay();
return;
}
int cellId = -1;
int cellIndex = -1;
switch (option.Type)
Expand Down
Loading