From c45b3d71148a77f369f7cce151e1c1c3cd1413d3 Mon Sep 17 00:00:00 2001 From: Jesper Frickmann Date: Sun, 16 Jan 2022 19:20:40 -0500 Subject: [PATCH] Fix: [lua] Do not ever convert name to a number with getFieldInfo(name) (#1423) Fix for Issue #1346 --- radio/src/lua/api_general.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/lua/api_general.cpp b/radio/src/lua/api_general.cpp index 42773c46e..2fa6fc2bb 100644 --- a/radio/src/lua/api_general.cpp +++ b/radio/src/lua/api_general.cpp @@ -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);