luaA_object_emit_signal: Fix a crash on non-objects
This was first fixed in79b1f5aba1
, but3fbb5f15
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:
parent
3b08f0d73a
commit
a8fa910586
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue