luaobject: check that object is userdata

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-22 13:20:55 +02:00
parent 901029ce97
commit 8da6a20f27
1 changed files with 2 additions and 0 deletions

View File

@ -224,6 +224,8 @@ luaA_object_emit_signal(lua_State *L, int oud,
{
int oud_abs = luaA_absindex(L, oud);
lua_object_t *obj = lua_touserdata(L, oud);
if(!obj)
luaL_error(L, "trying to emit signal on non-object");
signal_t *sigfound = signal_array_getbyid(&obj->signals,
a_strhash((const unsigned char *) name));
if(sigfound)