From a048cc9676f3572ebf5d6cc061f87cba85f5a249 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 25 Jan 2002 19:55:41 -0200 Subject: nil is a `valid' eventtable --- lbaselib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lbaselib.c') diff --git a/lbaselib.c b/lbaselib.c index b06cc2b3..87e417aa 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -140,8 +140,9 @@ static int luaB_eventtable (lua_State *L) { if (lua_isnone(L, 2)) lua_geteventtable(L, 1); else { + int t = lua_type(L, 2); + luaL_arg_check(L, t == LUA_TNIL || t == LUA_TTABLE, 2, "nil/table expected"); lua_settop(L, 2); - luaL_check_type(L, 2, LUA_TTABLE); lua_seteventtable(L, 1); } return 1; -- cgit v1.2.3-55-g6feb