From 5ac865294fc872862987562484c459f81ba7b111 Mon Sep 17 00:00:00 2001 From: philmoz Date: Wed, 7 Jan 2026 11:19:53 +1100 Subject: [PATCH] fix(color): lvgl.build() function not returning table of named objects (#6958) --- radio/src/lua/api_colorlcd_lvgl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/src/lua/api_colorlcd_lvgl.cpp b/radio/src/lua/api_colorlcd_lvgl.cpp index a9f6b0e56..38c79fbfb 100644 --- a/radio/src/lua/api_colorlcd_lvgl.cpp +++ b/radio/src/lua/api_colorlcd_lvgl.cpp @@ -278,7 +278,7 @@ static void buildLvgl(lua_State *L, int srcIndex, int refIndex) if (obj) { obj->create(L, -1); auto ref = obj->getRef(L); - if (p.name && refIndex != LUA_REFNIL) { + if (p.name && refIndex != 0) { lua_pushstring(L, p.name); lua_rawgeti(L, LUA_REGISTRYINDEX, ref); lua_settable(L, refIndex - 4); @@ -287,7 +287,7 @@ static void buildLvgl(lua_State *L, int srcIndex, int refIndex) lua_getfield(L, -1, "children"); auto prevParent = luaScriptManager->getTempParent(); luaScriptManager->setTempParent(obj); - buildLvgl(L, -1, (refIndex != LUA_REFNIL) ? refIndex - 3 : LUA_REFNIL); + buildLvgl(L, -1, (refIndex != 0) ? refIndex - 3 : LUA_REFNIL); lua_pop(L, 1); luaScriptManager->setTempParent(prevParent); } @@ -302,7 +302,7 @@ static void addChildren(lua_State *L, LvglWidgetObjectBase* obj) lua_getfield(L, -1, "children"); auto prevParent = luaScriptManager->getTempParent(); luaScriptManager->setTempParent(obj); - buildLvgl(L, -1, LUA_REFNIL); + buildLvgl(L, -1, 0); lua_pop(L, 1); luaScriptManager->setTempParent(prevParent); }