aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-06-22 14:00:57 +0200
committersapier <Sapier at GMX dot net>2014-06-22 14:00:57 +0200
commit2625323f25ebb4e9ab1079ff60a77b40f58c5bf9 (patch)
treeacd317c589340978bf5ad1a3e9fff2abacabcae2 /builtin
parent9056c163a738a2f66725ca9a3e48b59b2b0e2603 (diff)
downloadminetest-2625323f25ebb4e9ab1079ff60a77b40f58c5bf9.tar.gz
minetest-2625323f25ebb4e9ab1079ff60a77b40f58c5bf9.tar.bz2
minetest-2625323f25ebb4e9ab1079ff60a77b40f58c5bf9.zip
Fix menu crash due to lack of favourites list
Diffstat (limited to 'builtin')
-rw-r--r--builtin/mainmenu/tab_multiplayer.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/mainmenu/tab_multiplayer.lua b/builtin/mainmenu/tab_multiplayer.lua
index d2d87274e..c3a7d921e 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