diff options
author | sfan5 <sfan5@live.de> | 2018-02-18 10:40:45 +0100 |
---|---|---|
committer | SmallJoker <SmallJoker@users.noreply.github.com> | 2018-02-18 10:40:45 +0100 |
commit | 3f2e0c1206ed3d4dfe8a58048170a4ce3309b059 (patch) | |
tree | 953efbf6358fde65b5d350eb6475ae906c1943c5 /src/script/lua_api/l_nodemeta.cpp | |
parent | 46bbacee95b8cc68b7e531232a319ed46c2e1560 (diff) | |
download | minetest-3f2e0c1206ed3d4dfe8a58048170a4ce3309b059.tar.gz minetest-3f2e0c1206ed3d4dfe8a58048170a4ce3309b059.tar.bz2 minetest-3f2e0c1206ed3d4dfe8a58048170a4ce3309b059.zip |
Check argument types inside MetaDataRef Lua API (#7045)
Diffstat (limited to 'src/script/lua_api/l_nodemeta.cpp')
-rw-r--r-- | src/script/lua_api/l_nodemeta.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/lua_api/l_nodemeta.cpp b/src/script/lua_api/l_nodemeta.cpp index 3d7adf27d..348d73ad5 100644 --- a/src/script/lua_api/l_nodemeta.cpp +++ b/src/script/lua_api/l_nodemeta.cpp @@ -159,7 +159,7 @@ bool NodeMetaRef::handleFromTable(lua_State *L, int table, Metadata *_meta) lua_pushnil(L); while (lua_next(L, inventorytable) != 0) { // key at index -2 and value at index -1 - std::string name = lua_tostring(L, -2); + std::string name = luaL_checkstring(L, -2); read_inventory_list(L, -1, inv, name.c_str(), getServer(L)); lua_pop(L, 1); // Remove value, keep key for next iteration } |