Author: ai0867
Date: Mon Mar 14 00:29:39 2011
New Revision: 48902

URL: http://svn.gna.org/viewcvs/wesnoth?rev=48902&view=rev
Log:
Wesnoth now no longer segfaults on empty menus.

Modified:
    trunk/src/hotkeys.cpp

Modified: trunk/src/hotkeys.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/hotkeys.cpp?rev=48902&r1=48901&r2=48902&view=diff
==============================================================================
--- trunk/src/hotkeys.cpp (original)
+++ trunk/src/hotkeys.cpp Mon Mar 14 00:29:39 2011
@@ -1042,6 +1042,8 @@
 void command_executor::show_menu(const std::vector<std::string>& items_arg, 
int xloc, int yloc, bool context_menu, display& gui)
 {
        std::vector<std::string> items = items_arg;
+       if (items.empty())
+               return;
        if (can_execute_command(hotkey::get_hotkey(items.front()).get_id(), 0)){
                //if just one item is passed in, that means we should execute 
that item
                if(!context_menu && items.size() == 1 && items_arg.size() == 1) 
{


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to