+ if (!is_get)
+ {
+ GVariant *value;
+
+ /* Fail with org.freedesktop.DBus.Error.InvalidArgs if the type
+ * of the given value is wrong
+ */
+ g_variant_get_child (g_dbus_message_get_body (message), 2, "v", &value);
+ if (g_strcmp0 (g_variant_get_type_string (value), property_info->signature) != 0)
+ {
+ reply = g_dbus_message_new_method_error (message,
+ "org.freedesktop.DBus.Error.InvalidArgs",
+ _("Error setting property '%s': Expected type '%s' but got '%s'"),
+ property_name, property_info->signature,
+ g_variant_get_type_string (value));
+ g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
+ g_variant_unref (value);
+ g_object_unref (reply);
+ handled = TRUE;
+ goto out;
+ }
+
+ g_variant_unref (value);
+ }
+
+ /* If the vtable pointer for get_property() resp. set_property() is
+ * NULL then dispatch the call via the method_call() handler.
+ */
+ if (is_get)
+ {
+ if (vtable->get_property == NULL)
+ {
+ schedule_method_call (connection, message, registration_id, subtree_registration_id,
+ interface_info, NULL, property_info, g_dbus_message_get_body (message),
+ vtable, main_context, user_data);
+ handled = TRUE;
+ goto out;
+ }
+ }
+ else
+ {
+ if (vtable->set_property == NULL)
+ {
+ schedule_method_call (connection, message, registration_id, subtree_registration_id,
+ interface_info, NULL, property_info, g_dbus_message_get_body (message),
+ vtable, main_context, user_data);
+ handled = TRUE;
+ goto out;
+ }
+ }
+