]> git.mxchange.org Git - flightgear.git/commitdiff
Tolerate the lack of a GUI in some places.
authorJames Turner <zakalawe@mac.com>
Wed, 26 Sep 2012 12:39:38 +0000 (13:39 +0100)
committerJames Turner <zakalawe@mac.com>
Wed, 26 Sep 2012 12:39:38 +0000 (13:39 +0100)
src/ATC/atcdialog.cxx
src/Main/fg_commands.cxx

index f2e851e2691c15a1f3499626bfee127e51a7913f..ba7bc1791382e535b480b2356194de6065fc33d3 100644 (file)
@@ -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;
index f9efa5b4794b83b039dbdafe4541f80ab5ceb5b1..5611cbf10c471f0e548348da1bee9d280f5b19d5 100644 (file)
@@ -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