]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Add missing type check to InvRef:set_lists() (#10476)
authorZughy <63455151+Zughy@users.noreply.github.com>
Sun, 11 Oct 2020 11:36:13 +0000 (13:36 +0200)
committerGitHub <noreply@github.com>
Sun, 11 Oct 2020 11:36:13 +0000 (13:36 +0200)
src/script/lua_api/l_inventory.cpp

index e41b5cb41b4e0247077df30e4240422d9c6d1070..434d0a76ca269e582354131d1ac52617d4bf8383 100644 (file)
@@ -280,6 +280,7 @@ int InvRef::l_set_lists(lua_State *L)
        Server *server = getServer(L);
 
        lua_pushnil(L);
+       luaL_checktype(L, 2, LUA_TTABLE);
        while (lua_next(L, 2)) {
                const char *listname = lua_tostring(L, -2);
                read_inventory_list(L, -1, tempInv, listname, server);