Pcbnew: avoid crash if something is wrong when opening the Python Console (for instance missing python module).

This commit is contained in:
Jean-Pierre Charras
2016-02-07 19:38:08 -05:00
committed by Wayne Stambaugh
parent f46272bed9
commit 6c5e2f3900
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ KIFACE* KIWAY::KiFACE( FACE_T aFaceId, bool doLoad )
if( ! wxFileExists( dname ) )
msg << wxT( "It is missing.\n" );
else
msg << wxT( "Perhaps a wxWidgets shared (.dll or .so) file is missing.\n" );
msg << wxT( "Perhaps a shared library (.dll or .so) file is missing.\n" );
msg << wxT( "From command line: argv[0]:\n'" );
msg << wxStandardPaths::Get().GetExecutablePath() << wxT( "'\n" );
+4 -1
View File
@@ -994,7 +994,10 @@ void PCB_EDIT_FRAME::ScriptingConsoleEnableDisable( wxCommandEvent& aEvent )
else
pythonPanelShown = ! pythonPanelFrame->IsShown();
pythonPanelFrame->Show( pythonPanelShown );
if( pythonPanelFrame )
pythonPanelFrame->Show( pythonPanelShown );
else
wxMessageBox( wxT( "Error: unable to create the Python Console" ) );
}