pcbnew_scripting_helpers: fix a potential crash when running a script outside kicad.
BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat ) crashes if a old project file (*.pro) exists and the *.kicad_pro file doses not exists. The crash happens when trying to convert the old config outside kicad.
This commit is contained in:
parent
cc5493e91e
commit
69453964b4
|
@ -141,8 +141,11 @@ BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat )
|
|||
|
||||
if( !project )
|
||||
{
|
||||
GetSettingsManager()->LoadProject( projectPath, false );
|
||||
project = GetSettingsManager()->GetProject( projectPath );
|
||||
if( wxFileExists( projectPath ) )
|
||||
{
|
||||
GetSettingsManager()->LoadProject( projectPath, false );
|
||||
project = GetSettingsManager()->GetProject( projectPath );
|
||||
}
|
||||
}
|
||||
else if( s_PcbEditFrame && project == &GetSettingsManager()->Prj() )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue