]> git.mxchange.org Git - flightgear.git/commitdiff
make sure the index is in the array, which isn't necessarily the case,
authormfranz <mfranz>
Wed, 8 Feb 2006 17:18:24 +0000 (17:18 +0000)
committermfranz <mfranz>
Wed, 8 Feb 2006 17:18:24 +0000 (17:18 +0000)
because a dialog button can get pressed when its callback isn't available
any more. Ideally, we would close the dialog or update its buttons when
this happens. But this requires bigger changes.

src/ATC/ATCDialog.cxx

index d24b1b0249dc170bca68b7f5fe89cff3a2c63429..b2b6964cdcbdd15f39f568103e11011dc6fa4354 100644 (file)
@@ -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();