From 179e5c587d25e1f1b7aa275866d9eb6218201e24 Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 8 Feb 2006 17:18:24 +0000 Subject: [PATCH] make sure the index is in the array, which isn't necessarily the case, 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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();