mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-08 12:48:03 +02:00
lua: fail if an optional Interest is not none, nil, Interest or table
This commit is contained in:
parent
795a37d029
commit
18fe17fa01
1 changed files with 4 additions and 2 deletions
|
|
@ -643,15 +643,17 @@ static const luaL_Reg object_interest_methods[] = {
|
|||
static WpObjectInterest *
|
||||
get_optional_object_interest (lua_State *L, int idx, GType def_type)
|
||||
{
|
||||
if (lua_isnil (L, idx))
|
||||
if (lua_isnoneornil (L, idx))
|
||||
return NULL;
|
||||
else if (lua_isuserdata (L, idx))
|
||||
return wplua_checkboxed (L, idx, WP_TYPE_OBJECT_INTEREST);
|
||||
else if (lua_istable (L, idx)) {
|
||||
object_interest_new_index (L, idx, def_type);
|
||||
return wplua_toboxed (L, -1);
|
||||
} else
|
||||
} else {
|
||||
luaL_error (L, "expected Interest or none/nil");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* WpObjectManager */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue