nil is a `valid' eventtable

This commit is contained in:
Roberto Ierusalimschy
2002-01-25 19:55:41 -02:00
parent eb262bc617
commit a048cc9676
2 changed files with 7 additions and 4 deletions

View File

@@ -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;