VIEW_LIB_FRAME: catch exceptions for invalid libraries

This commit is contained in:
Maciej Suminski 2017-11-12 14:23:46 +01:00
parent a4b962e7d9
commit 75d9a18fc0
2 changed files with 12 additions and 2 deletions

View File

@ -495,7 +495,11 @@ bool LIB_VIEW_FRAME::ReCreateListCmp()
wxArrayString aliasNames;
Prj().SchSymbolLibTable()->EnumerateSymbolLib( m_libraryName, aliasNames, m_listPowerCmpOnly );
try
{
Prj().SchSymbolLibTable()->EnumerateSymbolLib( m_libraryName, aliasNames, m_listPowerCmpOnly );
}
catch( const IO_ERROR& e ) {} // ignore, it is handled below
if( aliasNames.IsEmpty() )
{

View File

@ -193,7 +193,13 @@ void LIB_VIEW_FRAME::DisplayLibInfos()
void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
{
LIB_ID id( m_libraryName, m_entryName );
LIB_ALIAS* entry = Prj().SchSymbolLibTable()->LoadSymbol( id );
LIB_ALIAS* entry = nullptr;
try
{
entry = Prj().SchSymbolLibTable()->LoadSymbol( id );
}
catch( const IO_ERROR& e ) {} // ignore, it is handled below
if( !entry )
return;