diff --git a/src/GUI/CanvasWidget.cxx b/src/GUI/CanvasWidget.cxx index 33f1af076..17e6aa758 100644 --- a/src/GUI/CanvasWidget.cxx +++ b/src/GUI/CanvasWidget.cxx @@ -82,6 +82,12 @@ CanvasWidget::CanvasWidget( int x, int y, if( load ) { const char *s = load->getStringValue(); + // avoid crash FLIGHTGEAR-5FQ + if (!s) { + SG_LOG(SG_GUI, SG_ALERT, "Empty 'load' script for Canvas widget:" << cprops->getStringValue("name")); + return; + } + nas->handleCommand(module.c_str(), file.c_str(), s, cprops); } }