summaryrefslogtreecommitdiff
path: root/telepathy-glib/contacts-mixin.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2010-03-26 11:39:22 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-03-31 13:24:32 +0100
commitd89ffcc59c13447c4fc1cfc6567de5864c86e54c (patch)
tree372599de1912b2e5e99874da822b4d0e5f958616 /telepathy-glib/contacts-mixin.c
parent5c1a25405b0e9c857d8b83337f1fd961a2cdd910 (diff)
downloadtelepathy-glib-d89ffcc59c13447c4fc1cfc6567de5864c86e54c.tar.gz
Make GetContactAttributes() tolerate unsupported interfaces
See http://bugs.freedesktop.org/show_bug.cgi?id=27325 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'telepathy-glib/contacts-mixin.c')
-rw-r--r--telepathy-glib/contacts-mixin.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/telepathy-glib/contacts-mixin.c b/telepathy-glib/contacts-mixin.c
index e5a137463..f0ae63678 100644
--- a/telepathy-glib/contacts-mixin.c
+++ b/telepathy-glib/contacts-mixin.c
@@ -282,19 +282,6 @@ tp_contacts_mixin_get_contact_attributes (
TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context);
- /* first validate the given interfaces */
- for (i = 0; interfaces[i] != NULL; i++) {
- if (g_hash_table_lookup (self->priv->interfaces, interfaces[i]) == NULL)
- {
- GError einval = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
- "Non-inspectable Interface given" };
-
- dbus_g_method_return_error (context, &einval);
- return;
- }
- }
-
-
/* Setup handle array and hash with valid handles, optionally holding them */
valid_handles = g_array_sized_new (TRUE, TRUE, sizeof (TpHandle),
handles->len);
@@ -336,9 +323,10 @@ tp_contacts_mixin_get_contact_attributes (
func = g_hash_table_lookup (self->priv->interfaces, interfaces[i]);
- g_assert (func != NULL);
-
- func (G_OBJECT(iface), valid_handles, result);
+ if (func == NULL)
+ DEBUG ("non-inspectable interface %s given; ignoring", interfaces[i]);
+ else
+ func (G_OBJECT(iface), valid_handles, result);
}
tp_svc_connection_interface_contacts_return_from_get_contact_attributes (