From 01a74e9c9e53f9c23b0314e8629d865677e53c2e Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 10 Mar 2009 09:17:00 +0100 Subject: [PATCH] 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 --- dbus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dbus.c b/dbus.c index 92e4f9fc9..1e04256a2 100644 --- a/dbus.c +++ b/dbus.c @@ -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++;