From a6b4485ac5ea0673e0ce35dab14e2df26c27823e Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Mon, 30 Sep 2024 08:37:38 -0500 Subject: More setup to configurable controls. --- src/luacxx.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/luacxx.cpp') diff --git a/src/luacxx.cpp b/src/luacxx.cpp index 926e30f..c4bc063 100644 --- a/src/luacxx.cpp +++ b/src/luacxx.cpp @@ -102,11 +102,14 @@ LuaResult> LuaContext::getGlobalStringArray(const char* } auto luaType = lua_getglobal(m_state, name); - static_cast(luaType); + if (luaType == LUA_TNONE || luaType == LUA_TNIL) { + lua_pop(m_state, 1); + return RetType::error(FudStatus::NotFound); + } - if (!lua_istable(m_state, -1)) { + if (luaType != LUA_TTABLE) { lua_pop(m_state, 1); - return RetType::error(FudStatus::Failure); + return RetType::error(FudStatus::InvalidInput); } int64_t length; -- cgit v1.2.3