From 9ea50023ee514dfd2ba0cdb53cef91d6b842bafc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tobias=20Gl=C3=A4=C3=9Fer?= Date: Sat, 7 Aug 2004 11:34:41 +0000 Subject: [PATCH] Empty menus shouldn't lead to crashs anymore. SVN-Revision: 1719 --- lib/gui/menu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gui/menu.cpp b/lib/gui/menu.cpp index 28e6efff7..d35f6d902 100644 --- a/lib/gui/menu.cpp +++ b/lib/gui/menu.cpp @@ -770,7 +770,7 @@ Menu::event(SDL_Event& event) /* An International Character. */ } - if(item[active_item].kind == MN_CONTROLFIELD_KB) + if(item.size() > 0 && item[active_item].kind == MN_CONTROLFIELD_KB) { if(key == SDLK_ESCAPE) { @@ -798,7 +798,7 @@ Menu::event(SDL_Event& event) menuaction = MENU_ACTION_RIGHT; break; case SDLK_SPACE: - if(item[active_item].kind == MN_TEXTFIELD) + if(item.size() > 0 && item[active_item].kind == MN_TEXTFIELD) { menuaction = MENU_ACTION_INPUT; mn_input_char = ' '; @@ -848,7 +848,7 @@ Menu::event(SDL_Event& event) } break; case SDL_JOYBUTTONDOWN: - if (item[active_item].kind == MN_CONTROLFIELD_JS) + if (item.size() > 0 && item[active_item].kind == MN_CONTROLFIELD_JS) { // FIXME: This next line does nothing useable, right? // *item[active_item].int_p = key; -- 2.11.0