From a9d6a899656da27708f915362e5d2f00904be7a1 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 5 Apr 2011 15:42:49 +0100 Subject: [PATCH 07/15] object_registration_message: make logic/assertions slightly clearer --- dbus/dbus-gobject.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c index fbe3740..008925c 100644 --- a/dbus/dbus-gobject.c +++ b/dbus/dbus-gobject.c @@ -2112,14 +2112,17 @@ object_registration_message (DBusConnection *connection, else return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } - else if (getter || setter) + else { + g_assert (getter || setter); + if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING) { ret = error_or_die (message, DBUS_ERROR_INVALID_ARGS, "Second argument to Get() or Set() must be a property name string"); goto out; } + dbus_message_iter_get_basic (&iter, &requested_propname); dbus_message_iter_next (&iter); @@ -2151,16 +2154,12 @@ object_registration_message (DBusConnection *connection, object, pspec); dbus_message_iter_next (&iter); } - else if (getter) + else { + g_assert (getter); ret = get_object_property (connection, message, object, pspec); } - else - { - g_assert_not_reached (); - ret = NULL; - } } else { -- 1.7.4.1