Fix crash updating gametype without game
authorsapier <Sapier at GMX dot net>
Sat, 9 Nov 2013 10:01:16 +0000 (11:01 +0100)
committersapier <Sapier at GMX dot net>
Sat, 9 Nov 2013 12:30:44 +0000 (13:30 +0100)
builtin/mainmenu.lua

index d818773c3a8a8ffc6586882c666e4c5f9b880683..7f3bf7f07ad8ab27eb1c4ab5b507943649328732 100644 (file)
@@ -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)