From: sapier Date: Sat, 9 Nov 2013 10:01:16 +0000 (+0100) Subject: Fix crash updating gametype without game X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=7bd30b59eee2f18ac7b893151f18d04711d665bc;p=zefram%2Fminetest%2Fminetest_engine.git Fix crash updating gametype without game --- diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index d818773c..7f3bf7f0 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)