From ed6cb5e4ae64a2f0fc1a08c3ea898a154fc1672d Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 24 Jul 2023 14:00:17 +0200 Subject: [PATCH] Fix theme menu check state. We'd always (wrongly) get the value from the last entry in the list. Reported by Stefano Rivera. --- nageru/theme.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- 2.39.2