From f7173d454f79cc6dfc3c20adeef37a0f2191a010 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 6 Feb 2026 09:08:27 -0800 Subject: [PATCH 1/2] Fixes LT-22404: Crash when selecting a category in Create New Gram Info --- Src/LexText/LexTextControls/MSAGroupBox.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/LexText/LexTextControls/MSAGroupBox.cs b/Src/LexText/LexTextControls/MSAGroupBox.cs index 49445e0570..7326695d16 100644 --- a/Src/LexText/LexTextControls/MSAGroupBox.cs +++ b/Src/LexText/LexTextControls/MSAGroupBox.cs @@ -743,8 +743,8 @@ private IEnumerable GetSlots() if (m_morphType == null) { // Not called by InsertEntryDlg; need to figure out the morphtype(s) - var lex = m_propertyTable.GetValue("ActiveClerkSelectedObject"); - if (lex != null) + var obj = m_propertyTable.GetValue("ActiveClerkSelectedObject"); + if (obj != null && obj is ILexEntry lex) { return DomainObjectServices.GetSlots(m_cache, lex, m_selectedMainPOS); } From 2968499f3277ae17128d8db353314d23f440e8b5 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 6 Feb 2026 10:07:50 -0800 Subject: [PATCH 2/2] Remove redundant null check --- Src/LexText/LexTextControls/MSAGroupBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/LexText/LexTextControls/MSAGroupBox.cs b/Src/LexText/LexTextControls/MSAGroupBox.cs index 7326695d16..b5a90a24e0 100644 --- a/Src/LexText/LexTextControls/MSAGroupBox.cs +++ b/Src/LexText/LexTextControls/MSAGroupBox.cs @@ -744,7 +744,7 @@ private IEnumerable GetSlots() { // Not called by InsertEntryDlg; need to figure out the morphtype(s) var obj = m_propertyTable.GetValue("ActiveClerkSelectedObject"); - if (obj != null && obj is ILexEntry lex) + if (obj is ILexEntry lex) { return DomainObjectServices.GetSlots(m_cache, lex, m_selectedMainPOS); }