From a9632600b69b5fd659de3e6f082e1359942e2c75 Mon Sep 17 00:00:00 2001 From: joshua Date: Mon, 1 Dec 2025 12:23:22 +0100 Subject: [PATCH] fix [diagram editor] : fix crash on search and replace widget Qet crash when double click on an element/text/conductor in the tree widget of the search and replace widget and the item is deleted from diagram. (Call of Diagram::showme to a nullptr). --- sources/SearchAndReplace/ui/searchandreplacewidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/SearchAndReplace/ui/searchandreplacewidget.cpp b/sources/SearchAndReplace/ui/searchandreplacewidget.cpp index e32f10fca..51b553a2e 100644 --- a/sources/SearchAndReplace/ui/searchandreplacewidget.cpp +++ b/sources/SearchAndReplace/ui/searchandreplacewidget.cpp @@ -961,21 +961,21 @@ void SearchAndReplaceWidget::on_m_tree_widget_itemDoubleClicked( else if (m_element_hash.keys().contains(item)) { QPointer elmt = m_element_hash.value(item); - if (elmt) { + if (elmt && elmt->diagram()) { elmt.data()->diagram()->showMe(); } } else if (m_text_hash.keys().contains(item)) { QPointer text = m_text_hash.value(item); - if (text) { + if (text && text->diagram()) { text.data()->diagram()->showMe(); } } else if (m_conductor_hash.keys().contains(item)) { QPointer cond = m_conductor_hash.value(item); - if (cond) { + if (cond && cond->diagram()) { cond.data()->diagram()->showMe(); } }