It was previously returning an empty table, although the comment said it
should have returned nil.
lua_KContext ctx ATTR_UNUSED)
{
/*
- * lua_dict_*_callback() already pushed the result table or error
+ * lua_dict_*_callback() already pushed the result table/nil or error
* string. We simply need to return/error out.
*/
- if (lua_istable(L, -1))
+ if (lua_istable(L, -1) || lua_isnil(L, -1))
return 1;
else
return lua_error(L);
{
if (result->ret < 0) {
lua_pushstring(L, result->error);
+ } else if (result->ret == 0) {
+ lua_pushnil(L);
} else {
unsigned int i;