diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-09-30 08:37:38 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-09-30 08:37:38 -0500 |
commit | a6b4485ac5ea0673e0ce35dab14e2df26c27823e (patch) | |
tree | d46f099858ae81622be1e7a6f7b5bd47d4c1cf27 /src/luacxx.cpp | |
parent | 6f2b61b676a16482fdac70a58a8e875c4d68e713 (diff) |
More setup to configurable controls.
Diffstat (limited to 'src/luacxx.cpp')
-rw-r--r-- | src/luacxx.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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<std::vector<std::string>> LuaContext::getGlobalStringArray(const char* } auto luaType = lua_getglobal(m_state, name); - static_cast<void>(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; |