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:
Julien Danjou 2009-03-10 09:17:00 +01:00
parent b07857b4f6
commit 01a74e9c9e
1 changed files with 4 additions and 2 deletions

6
dbus.c
View File

@ -47,6 +47,10 @@ a_dbus_message_iter(DBusMessageIter *iter)
{
switch(dbus_message_iter_get_arg_type(iter))
{
default:
lua_pushnil(globalconf.L);
nargs++;
break;
case DBUS_TYPE_INVALID:
break;
case DBUS_TYPE_VARIANT:
@ -123,9 +127,7 @@ a_dbus_message_iter(DBusMessageIter *iter)
int n = a_dbus_message_iter(&subiter);
for(int i = n; i > 0; i--)
{
lua_rawseti(globalconf.L, - i - 1, i);
}
}
}
nargs++;