Fixed a crash when _cvpcb.kiface is not available when opening cvpcb

This commit is contained in:
Maciej Suminski 2017-11-27 17:11:12 +01:00
parent 7aa6f9bd3f
commit 480b1c2592
1 changed files with 8 additions and 2 deletions

View File

@ -1142,10 +1142,12 @@ void SCH_EDIT_FRAME::OnOpenPcbModuleEditor( wxCommandEvent& event )
void SCH_EDIT_FRAME::OnOpenCvpcb( wxCommandEvent& event )
{
wxFileName fn = Prj().AbsolutePath( g_RootSheet->GetScreen()->GetFileName() );
fn.SetExt( NetlistFileExtension );
if( prepareForNetlist() )
if( !prepareForNetlist() )
return;
try
{
KIWAY_PLAYER* player = Kiway().Player( FRAME_CVPCB, false ); // test open already.
@ -1160,6 +1162,10 @@ void SCH_EDIT_FRAME::OnOpenCvpcb( wxCommandEvent& event )
player->Raise();
}
catch( const IO_ERROR& e )
{
DisplayError( this, _( "Could not open CvPcb" ) );
}
}