luaA_object_emit_signal: Fix a crash on non-objects

This was first fixed in 79b1f5aba1, but 3fbb5f15 reintroduced the crash. The
only "real" change in here is that there is now a "return;" after the
warn("Trying...");. The rest is just re-indentation.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2012-01-04 17:09:52 +01:00
parent 3b08f0d73a
commit a8fa910586
1 changed files with 28 additions and 28 deletions

View File

@ -254,9 +254,10 @@ 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)
if(!obj) {
warn("Trying to emit signal '%s' on non-object", name);
else {
return;
}
signal_t *sigfound = signal_array_getbyid(&obj->signals,
a_strhash((const unsigned char *) name));
if(sigfound)
@ -283,7 +284,6 @@ luaA_object_emit_signal(lua_State *L, int oud,
}
} else
warn("Trying to emit unknown signal '%s'", name);
}
/* Then emit signal on the class */
lua_pushvalue(L, oud);