mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
Catch errors when saving individual symbols
Fixes https://gitlab.com/kicad/code/kicad/issues/11566 (cherry picked from commit f4d4f238764b7a049730640840f0ac21a241b15c)
This commit is contained in:
parent
30ecca464d
commit
5f7ac58f95
@ -225,12 +225,14 @@ bool SYMBOL_LIBRARY_MANAGER::SaveLibrary( const wxString& aLibrary, const wxStri
|
|||||||
{
|
{
|
||||||
LIB_SYMBOL* newSymbol;
|
LIB_SYMBOL* newSymbol;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
if( symbol->IsAlias() )
|
if( symbol->IsAlias() )
|
||||||
{
|
{
|
||||||
std::shared_ptr< LIB_SYMBOL > oldParent = symbol->GetParent().lock();
|
std::shared_ptr< LIB_SYMBOL > oldParent = symbol->GetParent().lock();
|
||||||
|
|
||||||
wxCHECK_MSG( oldParent, false,
|
wxCHECK_MSG( oldParent, false,
|
||||||
wxString::Format( "Derived symbol '%s' found with undefined parent.",
|
wxString::Format( wxT( "Derived symbol '%s' found with undefined parent." ),
|
||||||
symbol->GetName() ) );
|
symbol->GetName() ) );
|
||||||
|
|
||||||
LIB_SYMBOL* libParent = pi->LoadSymbol( aLibrary, oldParent->GetName(),
|
LIB_SYMBOL* libParent = pi->LoadSymbol( aLibrary, oldParent->GetName(),
|
||||||
@ -251,6 +253,12 @@ bool SYMBOL_LIBRARY_MANAGER::SaveLibrary( const wxString& aLibrary, const wxStri
|
|||||||
pi->SaveSymbol( aLibrary, new LIB_SYMBOL( *symbol ), &properties );
|
pi->SaveSymbol( aLibrary, new LIB_SYMBOL( *symbol ), &properties );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch( ... )
|
||||||
|
{
|
||||||
|
res = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
Loading…
x
Reference in New Issue
Block a user