From: sapier Date: Sat, 9 Nov 2013 10:01:16 +0000 (+0100) Subject: Fix crash updating gametype without game X-Git-Tag: 0.4.8~59 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7bd30b59eee2f18ac7b893151f18d04711d665bc;p=oweals%2Fminetest.git Fix crash updating gametype without game --- 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)