aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/lua/converter.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/lua/converter.c b/src/nvim/lua/converter.c
index fd4cfc4c31..ca3c4f604a 100644
--- a/src/nvim/lua/converter.c
+++ b/src/nvim/lua/converter.c
@@ -1303,6 +1303,12 @@ void nlua_init_types(lua_State *const lstate)
void nlua_pop_keydict(lua_State *L, void *retval, field_hash hashy, Error *err)
{
+ if (!lua_istable(L, -1)) {
+ api_set_error(err, kErrorTypeValidation, "Expected lua table");
+ lua_pop(L, -1);
+ return;
+ }
+
lua_pushnil(L); // [dict, nil]
while (lua_next(L, -2)) {
// [dict, key, value]