summaryrefslogtreecommitdiff
path: root/src/luacxx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/luacxx.cpp')
-rw-r--r--src/luacxx.cpp9
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;