From 6c5e2f39008088cf79b66ea4deec5481ca3e8b6c Mon Sep 17 00:00:00 2001 From: Jean-Pierre Charras Date: Sun, 7 Feb 2016 19:38:08 -0500 Subject: [PATCH] Pcbnew: avoid crash if something is wrong when opening the Python Console (for instance missing python module). --- common/kiway.cpp | 2 +- pcbnew/pcbframe.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/kiway.cpp b/common/kiway.cpp index 4d6e6fa2a9..7919b9c888 100644 --- a/common/kiway.cpp +++ b/common/kiway.cpp @@ -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" ); diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index b19fca1935..6e4ec65cdc 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -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" ) ); }