dbus: push nil on unhandled elements
That fix the handling of dict in case we do not handle the value, we would get: dict entry ( type type-not-handled ) returned as 1 value (the key), and lua_rawset() would fail later. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
b07857b4f6
commit
01a74e9c9e
6
dbus.c
6
dbus.c
|
@ -47,6 +47,10 @@ a_dbus_message_iter(DBusMessageIter *iter)
|
||||||
{
|
{
|
||||||
switch(dbus_message_iter_get_arg_type(iter))
|
switch(dbus_message_iter_get_arg_type(iter))
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
lua_pushnil(globalconf.L);
|
||||||
|
nargs++;
|
||||||
|
break;
|
||||||
case DBUS_TYPE_INVALID:
|
case DBUS_TYPE_INVALID:
|
||||||
break;
|
break;
|
||||||
case DBUS_TYPE_VARIANT:
|
case DBUS_TYPE_VARIANT:
|
||||||
|
@ -123,9 +127,7 @@ a_dbus_message_iter(DBusMessageIter *iter)
|
||||||
int n = a_dbus_message_iter(&subiter);
|
int n = a_dbus_message_iter(&subiter);
|
||||||
|
|
||||||
for(int i = n; i > 0; i--)
|
for(int i = n; i > 0; i--)
|
||||||
{
|
|
||||||
lua_rawseti(globalconf.L, - i - 1, i);
|
lua_rawseti(globalconf.L, - i - 1, i);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nargs++;
|
nargs++;
|
||||||
|
|
Loading…
Reference in New Issue