fixed crash when you press escape when a menu is displayed

This commit is contained in:
uid68803 2004-02-23 21:18:34 +00:00
parent e68ee4a5f4
commit 641fc00cd0

View file

@ -794,7 +794,7 @@ void turn_info::show_menu(const std::vector<std::string>& items_arg, int xloc, i
static const std::string style = "menu2";
const int res = gui::show_dialog(gui_,NULL,"","",
gui::MESSAGE,&menu,NULL,"",NULL,NULL,NULL,xloc,yloc,&style);
if(res == -1)
if(res < 0 || res >= items.size())
return;
const hotkey::HOTKEY_COMMAND cmd = hotkey::string_to_command(items[res]);