diff --git a/lualib-src/lua-seri.c b/lualib-src/lua-seri.c index 6e118230..1d12e263 100644 --- a/lualib-src/lua-seri.c +++ b/lualib-src/lua-seri.c @@ -260,7 +260,7 @@ wb_table(lua_State *L, struct write_block *wb, int index, int depth) { if (index < 0) { index = lua_gettop(L) + index + 1; } - if (luaL_getmetafield(L, index, "__pairs")) { + if (luaL_getmetafield(L, index, "__pairs") != LUA_TNIL) { uint8_t n = COMBINE_TYPE(TYPE_TABLE, 0); wb_push(wb, &n, 1); lua_pushvalue(L, index);