]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATCDCL/ATCDialogOld.cxx
Merge branch 'attenuation' into navaids-radio
[flightgear.git] / src / ATCDCL / ATCDialogOld.cxx
index bb3cc1650fa46eefd11cb9f854e43d2fa61a72e1..b1824180cbf5989bb22c79bb559b50913f81080c 100644 (file)
@@ -30,6 +30,7 @@
 #include <Main/globals.hxx>
 #include <GUI/gui.h>           // mkDialog
 #include <GUI/new_gui.hxx>
+#include <Main/fg_props.hxx>
 
 #include "ATCDialogOld.hxx"
 #include "ATC.hxx"
@@ -205,7 +206,13 @@ void FGATCDialog::PopupDialog() {
        button_group->removeChildren("button", false);
 
        string label;
-       FGATC* atcptr = globals->get_ATC_mgr()->GetComm1ATCPointer();   // Hardwired to comm1 at the moment
+       FGATCMgr* pAtcMgr = globals->get_ATC_mgr();
+       if (!pAtcMgr)
+       {
+           SG_LOG(SG_ATC, SG_ALERT, "ERROR! No ATC manager! Oops...");
+           return;
+       }
+       FGATC* atcptr = pAtcMgr->GetComm1ATCPointer();  // Hardwired to comm1 at the moment
 
        if (!atcptr) {
                label = "Not currently tuned to any ATC service";
@@ -260,7 +267,13 @@ void FGATCDialog::PopupDialog() {
 }
 
 void FGATCDialog::PopupCallback(int num) {
-       FGATC* atcptr = globals->get_ATC_mgr()->GetComm1ATCPointer();   // FIXME - Hardwired to comm1 at the moment
+    FGATCMgr* pAtcMgr = globals->get_ATC_mgr();
+    if (!pAtcMgr)
+    {
+        SG_LOG(SG_ATC, SG_ALERT, "ERROR! No ATC manager! Oops...");
+        return;
+    }
+       FGATC* atcptr = pAtcMgr->GetComm1ATCPointer();  // FIXME - Hardwired to comm1 at the moment
 
        if (!atcptr)
                return;