1
0
Fork 0

Tolerate the lack of a GUI in some places.

This commit is contained in:
James Turner 2012-09-26 13:39:38 +01:00
parent b5820a4e90
commit ebf3a0793d
2 changed files with 8 additions and 1 deletions

View file

@ -248,6 +248,10 @@ void FGATCDialogNew::update(double dt) {
const char *dialog_name = "atc-dialog"; const char *dialog_name = "atc-dialog";
_gui = (NewGUI *)globals->get_subsystem("gui"); _gui = (NewGUI *)globals->get_subsystem("gui");
if (!_gui) {
return;
}
SGPropertyNode_ptr dlg = _gui->getDialogProperties(dialog_name); SGPropertyNode_ptr dlg = _gui->getDialogProperties(dialog_name);
if (!dlg) if (!dlg)
return; return;

View file

@ -1022,6 +1022,9 @@ static bool
do_dialog_new (const SGPropertyNode * arg) do_dialog_new (const SGPropertyNode * arg)
{ {
NewGUI * gui = (NewGUI *)globals->get_subsystem("gui"); NewGUI * gui = (NewGUI *)globals->get_subsystem("gui");
if (!gui) {
return false;
}
// Note the casting away of const: this is *real*. Doing a // Note the casting away of const: this is *real*. Doing a
// "dialog-apply" command later on will mutate this property node. // "dialog-apply" command later on will mutate this property node.