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

This commit is contained in:
Wayne Stambaugh 2023-05-05 12:31:37 -04:00
parent b41d446f58
commit 51fd7ca5ed
1 changed files with 6 additions and 1 deletions

View File

@ -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<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;