From: Guo Rui Date: Mon, 27 Jul 2009 17:13:44 +0000 (+0800) Subject: Correct LuaRegEvent to use broker. X-Git-Url: https://repo.or.cz/w/screen-lua.git/commitdiff_plain/12f00ee7428658254a13266a3cec7f8a693335fc Correct LuaRegEvent to use broker. --- diff --git a/src/lua.c b/src/lua.c index 09dc95e..0157cb4 100644 --- a/src/lua.c +++ b/src/lua.c @@ -1516,7 +1516,11 @@ LuaRegEvent(lua_State *L) if (!strcmp("screen", objname)) objname = "global"; else - obj = *(char **)lua_touserdata(L, 1); + { + obj = get_broker_obj((struct broker **)lua_touserdata(L, 1)); + if (!obj) + return luaL_error(L, "Invalid object specified"); + } idx++; }