Fix: [lua] Do not ever convert name to a number with getFieldInfo(name) (#1423)

Fix for Issue #1346
This commit is contained in:
Jesper Frickmann
2022-01-17 10:20:40 +10:00
committed by GitHub
parent 1fe4936e7e
commit c45b3d7114
+1 -1
View File
@@ -843,7 +843,7 @@ static int luaGetFieldInfo(lua_State * L)
bool found;
LuaField field;
if (lua_isnumber(L, 1))
if (lua_type(L, 1) == LUA_TNUMBER)
found = luaFindFieldById(luaL_checkinteger(L, 1), field, FIND_FIELD_DESC);
else
found = luaFindFieldByName(luaL_checkstring(L, 1), field, FIND_FIELD_DESC);