#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"
#include <sstream>
using std::ostringstream;
+using std::cerr;
+using std::endl;
FGATCDialog *current_atcdialog;
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";
}
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;