From: sapier Date: Sun, 22 Jun 2014 12:00:57 +0000 (+0200) Subject: Fix menu crash due to lack of favourites list X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=2625323f25ebb4e9ab1079ff60a77b40f58c5bf9;p=zefram%2Fminetest%2Fminetest_engine.git Fix menu crash due to lack of favourites list --- diff --git a/builtin/mainmenu/tab_multiplayer.lua b/builtin/mainmenu/tab_multiplayer.lua index d2d87274..c3a7d921 100644 --- a/builtin/mainmenu/tab_multiplayer.lua +++ b/builtin/mainmenu/tab_multiplayer.lua @@ -138,6 +138,12 @@ local function main_button_handler(tabview, fields, name, tabdata) else fav_idx = 1 end + + if menudata.favorites == nil or + menudata.favorites[fav_idx] == nil then + tabdata.fav_selected = 0 + return true + end local address = menudata.favorites[fav_idx].address local port = menudata.favorites[fav_idx].port