From: James Turner Date: Wed, 26 Sep 2012 12:39:38 +0000 (+0100) Subject: Tolerate the lack of a GUI in some places. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ebf3a0793dfe62f3be6295e03b9ab8afb5306cb3;p=flightgear.git Tolerate the lack of a GUI in some places. --- diff --git a/src/ATC/atcdialog.cxx b/src/ATC/atcdialog.cxx index f2e851e26..ba7bc1791 100644 --- a/src/ATC/atcdialog.cxx +++ b/src/ATC/atcdialog.cxx @@ -248,6 +248,10 @@ void FGATCDialogNew::update(double dt) { const char *dialog_name = "atc-dialog"; _gui = (NewGUI *)globals->get_subsystem("gui"); + if (!_gui) { + return; + } + SGPropertyNode_ptr dlg = _gui->getDialogProperties(dialog_name); if (!dlg) return; diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index f9efa5b47..5611cbf10 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -1022,7 +1022,10 @@ static bool do_dialog_new (const SGPropertyNode * arg) { NewGUI * gui = (NewGUI *)globals->get_subsystem("gui"); - + if (!gui) { + return false; + } + // Note the casting away of const: this is *real*. Doing a // "dialog-apply" command later on will mutate this property node. // I'm not convinced that this isn't the Right Thing though; it