From 51fd7ca5ed062d53472a0cc8715b53c04ce8cbb8 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Fri, 5 May 2023 12:31:37 -0400 Subject: [PATCH] Verify parent symbol shared pointer is still valid in symbol editor. --- eeschema/symbol_editor/symbol_edit_frame.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index a6c054b7ce..2ef8afcb71 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -795,7 +795,12 @@ void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom ) } else if( IsSymbolAlias() ) { - wxString parentSymbolName = m_symbol->GetParent().lock()->GetName(); + std::shared_ptr parent = m_symbol->GetParent().lock(); + + // Don't assume the parent symbol shared pointer is still valid. + wxCHECK( parent, /* void */ ); + + wxString parentSymbolName = parent->GetName(); int unit = GetUnit(); int convert = GetConvert(); wxString msg;