From 75d9a18fc008017238ea71af4e6e96f49d4ac127 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Sun, 12 Nov 2017 14:23:46 +0100 Subject: [PATCH] VIEW_LIB_FRAME: catch exceptions for invalid libraries --- eeschema/viewlib_frame.cpp | 6 +++++- eeschema/viewlibs.cpp | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/eeschema/viewlib_frame.cpp b/eeschema/viewlib_frame.cpp index 2f301dc2c7..85a5b5abf8 100644 --- a/eeschema/viewlib_frame.cpp +++ b/eeschema/viewlib_frame.cpp @@ -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() ) { diff --git a/eeschema/viewlibs.cpp b/eeschema/viewlibs.cpp index a73999d98f..fce60b5106 100644 --- a/eeschema/viewlibs.cpp +++ b/eeschema/viewlibs.cpp @@ -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;