diff --git a/src/ATC/ATCDialog.cxx b/src/ATC/ATCDialog.cxx index d24b1b024..b2b6964cd 100644 --- a/src/ATC/ATCDialog.cxx +++ b/src/ATC/ATCDialog.cxx @@ -264,7 +264,8 @@ void FGATCDialog::PopupCallback(int num) { //cout << "TOWER " << endl; //cout << "ident is " << atcptr->get_ident() << endl; atcmentry_vec_type atcmlist = (available_dialog[TOWER])[atcptr->get_ident()]; - if(atcmlist.size()) { + unsigned int size = atcmlist.size(); + if(size && num < size) { //cout << "Doing callback...\n"; ATCMenuEntry a = atcmlist[num]; atcptr->SetFreqInUse();