mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-04 23:38:01 +02:00
lua api: allow nil to be passed on all constructors that take optional properties
This commit is contained in:
parent
a6bea40172
commit
cf4fb87b35
1 changed files with 6 additions and 6 deletions
|
|
@ -873,7 +873,7 @@ impl_metadata_new (lua_State *L)
|
|||
const char *name = luaL_checkstring (L, 1);
|
||||
WpProperties *properties = NULL;
|
||||
|
||||
if (lua_type (L, 2) != LUA_TNONE) {
|
||||
if (lua_type (L, 2) != LUA_TNONE && lua_type (L, 2) != LUA_TNIL) {
|
||||
luaL_checktype (L, 2, LUA_TTABLE);
|
||||
properties = wplua_table_to_properties (L, 2);
|
||||
}
|
||||
|
|
@ -899,7 +899,7 @@ device_new (lua_State *L)
|
|||
const char *factory = luaL_checkstring (L, 1);
|
||||
WpProperties *properties = NULL;
|
||||
|
||||
if (lua_type (L, 2) != LUA_TNONE) {
|
||||
if (lua_type (L, 2) != LUA_TNONE && lua_type (L, 2) != LUA_TNIL) {
|
||||
luaL_checktype (L, 2, LUA_TTABLE);
|
||||
properties = wplua_table_to_properties (L, 2);
|
||||
}
|
||||
|
|
@ -919,7 +919,7 @@ spa_device_new (lua_State *L)
|
|||
const char *factory = luaL_checkstring (L, 1);
|
||||
WpProperties *properties = NULL;
|
||||
|
||||
if (lua_type (L, 2) != LUA_TNONE) {
|
||||
if (lua_type (L, 2) != LUA_TNONE && lua_type (L, 2) != LUA_TNIL) {
|
||||
luaL_checktype (L, 2, LUA_TTABLE);
|
||||
properties = wplua_table_to_properties (L, 2);
|
||||
}
|
||||
|
|
@ -977,7 +977,7 @@ node_new (lua_State *L)
|
|||
const char *factory = luaL_checkstring (L, 1);
|
||||
WpProperties *properties = NULL;
|
||||
|
||||
if (lua_type (L, 2) != LUA_TNONE) {
|
||||
if (lua_type (L, 2) != LUA_TNONE && lua_type (L, 2) != LUA_TNIL) {
|
||||
luaL_checktype (L, 2, LUA_TTABLE);
|
||||
properties = wplua_table_to_properties (L, 2);
|
||||
}
|
||||
|
|
@ -1086,7 +1086,7 @@ impl_node_new (lua_State *L)
|
|||
const char *factory = luaL_checkstring (L, 1);
|
||||
WpProperties *properties = NULL;
|
||||
|
||||
if (lua_type (L, 2) != LUA_TNONE) {
|
||||
if (lua_type (L, 2) != LUA_TNONE && lua_type (L, 2) != LUA_TNIL) {
|
||||
luaL_checktype (L, 2, LUA_TTABLE);
|
||||
properties = wplua_table_to_properties (L, 2);
|
||||
}
|
||||
|
|
@ -1122,7 +1122,7 @@ link_new (lua_State *L)
|
|||
const char *factory = luaL_checkstring (L, 1);
|
||||
WpProperties *properties = NULL;
|
||||
|
||||
if (lua_type (L, 2) != LUA_TNONE) {
|
||||
if (lua_type (L, 2) != LUA_TNONE && lua_type (L, 2) != LUA_TNIL) {
|
||||
luaL_checktype (L, 2, LUA_TTABLE);
|
||||
properties = wplua_table_to_properties (L, 2);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue