From 6de25e2284ad373f7b29945032c5881914789e16 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 16 Jan 2023 18:10:54 +0000 Subject: [PATCH] Lifecycle safety for highlight net items. This possibly fixes Sentry issue KICAD-6E. --- eeschema/sch_edit_frame.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index fbee35f941..950f0c4ab1 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1438,11 +1438,14 @@ void SCH_EDIT_FRAME::initScreenZoom() void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags ) { const SCH_CONNECTION* highlight = GetHighlightedConnection(); - SCH_ITEM* highlightedItem = highlight ? highlight->Parent() : nullptr; - SCH_SHEET_PATH highlightPath; + SCH_ITEM* highlightedItem = nullptr; + SCH_SHEET_PATH highlightPath; if( highlight ) + { highlightPath = highlight->LocalSheet(); + highlightedItem = dynamic_cast( GetItem( highlight->Parent()->m_Uuid ) ); + } SCHEMATIC_SETTINGS& settings = Schematic().Settings(); SCH_SHEET_LIST list = Schematic().GetSheets();