Symbol editor: fix crash whe changing symbol name.

Fixes https://gitlab.com/kicad/code/kicad/issues/7791
This commit is contained in:
Wayne Stambaugh 2021-03-04 18:21:41 -05:00
parent 7a00e01b3e
commit 6cdc3664ba
1 changed files with 2 additions and 1 deletions

View File

@ -897,7 +897,8 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer( SYMBOL_LIBRARY_MANAGER::PAR
// Delete the original symbol if the symbol name has been changed. // Delete the original symbol if the symbol name has been changed.
if( part->GetName() != originalPart->GetName() ) if( part->GetName() != originalPart->GetName() )
{ {
aLibTable->DeleteSymbol( m_libName, originalPart->GetName() ); if( aLibTable->LoadSymbol( m_libName, originalPart->GetName() ) )
aLibTable->DeleteSymbol( m_libName, originalPart->GetName() );
} }
if( part->IsAlias() ) if( part->IsAlias() )