From 7bd30b59eee2f18ac7b893151f18d04711d665bc Mon Sep 17 00:00:00 2001 From: sapier Date: Sat, 9 Nov 2013 11:01:16 +0100 Subject: [PATCH] Fix crash updating gametype without game --- builtin/mainmenu.lua | 5 +++-- 1 file 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)