aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2013-11-09 11:01:16 +0100
committersapier <Sapier at GMX dot net>2013-11-09 13:30:44 +0100
commit7bd30b59eee2f18ac7b893151f18d04711d665bc (patch)
tree41d8f094b2c2628151fec50ca66164bd96ad29f8
parent1afd3595505e1f1cbcf727682194ab755ac005f4 (diff)
downloadminetest-7bd30b59eee2f18ac7b893151f18d04711d665bc.tar.gz
minetest-7bd30b59eee2f18ac7b893151f18d04711d665bc.tar.bz2
minetest-7bd30b59eee2f18ac7b893151f18d04711d665bc.zip
Fix crash updating gametype without game
-rw-r--r--builtin/mainmenu.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua
index d818773c3..7f3bf7f07 100644
--- a/builtin/mainmenu.lua
+++ b/builtin/mainmenu.lua
@@ -1191,12 +1191,13 @@ end
--------------------------------------------------------------------------------
function menu.update_gametype(reset)
- if reset then
+ local game = menu.lastgame()
+
+ if reset or game == nil then
mm_texture.reset()
engine.set_topleft_text("")
filterlist.set_filtercriteria(worldlist,nil)
else
- local game = menu.lastgame()
mm_texture.update(tabbuilder.current_tab,game)
engine.set_topleft_text(game.name)
filterlist.set_filtercriteria(worldlist,game.id)