diff options
author | sapier <Sapier at GMX dot net> | 2014-06-22 14:00:57 +0200 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2014-06-22 14:00:57 +0200 |
commit | 2625323f25ebb4e9ab1079ff60a77b40f58c5bf9 (patch) | |
tree | acd317c589340978bf5ad1a3e9fff2abacabcae2 | |
parent | 9056c163a738a2f66725ca9a3e48b59b2b0e2603 (diff) | |
download | minetest-2625323f25ebb4e9ab1079ff60a77b40f58c5bf9.tar.gz minetest-2625323f25ebb4e9ab1079ff60a77b40f58c5bf9.tar.bz2 minetest-2625323f25ebb4e9ab1079ff60a77b40f58c5bf9.zip |
Fix menu crash due to lack of favourites list
-rw-r--r-- | builtin/mainmenu/tab_multiplayer.lua | 6 |
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 |