7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 10:01:40 +00:00

Catch exceptions from a failed library load.

This commit is contained in:
Jeff Young 2020-01-13 14:52:56 +00:00
parent d3c7bd3a88
commit ac096fdf99

View File

@ -270,11 +270,17 @@ PART_LIB* PART_LIBS::AddLibrary( const wxString& aFileName )
if( lib )
return lib;
lib = PART_LIB::LoadLibrary( aFileName );
try
{
lib = PART_LIB::LoadLibrary( aFileName );
push_back( lib );
push_back( lib );
return lib;
return lib;
}
catch( ... )
{
return nullptr;
}
}
@ -287,14 +293,21 @@ PART_LIB* PART_LIBS::AddLibrary( const wxString& aFileName, PART_LIBS::iterator&
if( lib )
return lib;
lib = PART_LIB::LoadLibrary( aFileName );
try
{
lib = PART_LIB::LoadLibrary( aFileName );
if( aIterator >= begin() && aIterator < end() )
insert( aIterator, lib );
else
push_back( lib );
if( aIterator >= begin() && aIterator < end() )
insert( aIterator, lib );
else
push_back( lib );
return lib;
return lib;
}
catch( ... )
{
return nullptr;
}
}