From: Steinar H. Gunderson Date: Mon, 24 Jul 2023 12:00:17 +0000 (+0200) Subject: Fix theme menu check state. X-Git-Tag: 2.2.3~2 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=ed6cb5e4ae64a2f0fc1a08c3ea898a154fc1672d Fix theme menu check state. We'd always (wrongly) get the value from the last entry in the list. Reported by Stefano Rivera. --- diff --git a/nageru/theme.cpp b/nageru/theme.cpp index 937043f..19c90d4 100644 --- a/nageru/theme.cpp +++ b/nageru/theme.cpp @@ -2074,8 +2074,8 @@ unique_ptr create_theme_menu_entry(lua_State *L, int index) lua_pop(L, 1); unsigned flags = 0; - if (lua_objlen(L, -1) > 2) { - lua_rawgeti(L, -1, 3); + if (lua_objlen(L, index) > 2) { + lua_rawgeti(L, index, 3); flags = luaL_checknumber(L, -1); lua_pop(L, 1); }