From 8fbbd1b2d0a58a8d30fea5c469ca4373fed19e89 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 4 Aug 2025 08:55:53 -0700 Subject: [PATCH] Fix LT-20337: Crash Navigating From Bulk Edit Phoneme Features --- .../LexTextControls/PhonologicalFeaturePopupTreeManager.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Src/LexText/LexTextControls/PhonologicalFeaturePopupTreeManager.cs b/Src/LexText/LexTextControls/PhonologicalFeaturePopupTreeManager.cs index 53e5efef59..7c2fd3cbc4 100644 --- a/Src/LexText/LexTextControls/PhonologicalFeaturePopupTreeManager.cs +++ b/Src/LexText/LexTextControls/PhonologicalFeaturePopupTreeManager.cs @@ -221,9 +221,12 @@ protected override void Dispose(bool disposing) { Cache.DomainDataByFlid.BeginUndoTask(LexTextControls.ksUndoInsertPhonologicalFeature, LexTextControls.ksRedoInsertPhonologicalFeature); - foreach (var cmBaseAnnotation in m_annotations) + foreach (var cmBaseAnnotation in m_annotations.ToList()) { - cmBaseAnnotation.Delete(); + if (cmBaseAnnotation.IsValidObject) + cmBaseAnnotation.Delete(); + else + m_annotations.Remove(cmBaseAnnotation); } Cache.DomainDataByFlid.EndUndoTask(); }