From f51f30fb1eb9ffdee84b266b7cb011ce23510eb4 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 31 May 2018 09:08:58 +0200 Subject: [PATCH] eeschema: Disabled an assert checking if project path is empty Empty project path is a valid case when eeschema is executed in standalone mode without any file loaded. There were no observed harmful consequences of running eeschema without the project path set, but to stay safe the project specific sym-lib-table load code is executed only when the project path is set. --- eeschema/eeschema_config.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 205ab26749..24c74fe060 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -779,20 +779,21 @@ SYMBOL_LIB_TABLE* PROJECT::SchSymbolLibTable() wxGetEnv( PROJECT_VAR_NAME, &prjPath ); - wxASSERT( !prjPath.empty() ); - - wxFileName fn( prjPath, SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() ); - - try + if( !prjPath.IsEmpty() ) { - tbl->Load( fn.GetFullPath() ); - } - catch( const IO_ERROR& ioe ) - { - wxString msg; - msg.Printf( _( "An error occurred loading the symbol library table \"%s\"." ), - fn.GetFullPath() ); - DisplayErrorMessage( NULL, msg, ioe.What() ); + wxFileName fn( prjPath, SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() ); + + try + { + tbl->Load( fn.GetFullPath() ); + } + catch( const IO_ERROR& ioe ) + { + wxString msg; + msg.Printf( _( "An error occurred loading the symbol library table \"%s\"." ), + fn.GetFullPath() ); + DisplayErrorMessage( NULL, msg, ioe.What() ); + } } }