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.
This commit is contained in:
Maciej Suminski 2018-05-31 09:08:58 +02:00
parent c5cde53dff
commit f51f30fb1e
1 changed files with 14 additions and 13 deletions

View File

@ -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() );
}
}
}