Don't use luaL_error in luaA_object_emit_signal (FS#713)

This function can be called from unprotected contexts. Calling luaL_error() in
this case results in a call to luaA_panic() and awesome dies.

The only real change here is that this now calls warn() instead of luaL_error().
The rest is reindentation because warn() returns while luaL_error() didn't.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-12-11 13:48:31 +01:00
parent 22a5137299
commit 79b1f5aba1

View file

@ -255,7 +255,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");
warn("Trying to emit signal '%s' on non-object", name);
else {
signal_t *sigfound = signal_array_getbyid(&obj->signals,
a_strhash((const unsigned char *) name));
if(sigfound)
@ -282,6 +283,7 @@ 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);