Verify parent symbol shared pointer is still valid in symbol editor.

(cherry picked from commit 51fd7ca5ed)
This commit is contained in:
Wayne Stambaugh 2023-05-05 12:31:37 -04:00
parent e28b50e8d6
commit 2ae2d7ee1a
1 changed files with 6 additions and 1 deletions

View File

@ -794,7 +794,12 @@ void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom )
}
else if( IsSymbolAlias() )
{
wxString parentSymbolName = m_symbol->GetParent().lock()->GetName();
std::shared_ptr<LIB_SYMBOL> 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;