[Telepathy-commits] [telepathy-glib/master] fd.o #19688: tp_connection_get_contacts_by_id: don't assert if all contacts' IDs are bad

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Jan 29 07:29:50 PST 2009


tp_connection_get_contact_attributes asserts that there is at least
one handle, so if this is not true, we need to avoid calling it.
---
 telepathy-glib/contact.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index faf99ec..7ddfc2e 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -1773,6 +1773,14 @@ contacts_get_attributes (ContactsContext *context)
   const gchar **supported_interfaces;
   guint i;
 
+  /* tp_connection_get_contact_attributes insists that you have at least one
+   * handle; skip it if we don't (can only happen if we started from IDs) */
+  if (context->handles->len == 0)
+    {
+      contacts_context_continue (context);
+      return;
+    }
+
   g_assert (tp_proxy_has_interface_by_id (context->connection,
         TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS));
   g_assert (contact_attribute_interfaces != NULL);
-- 
1.5.6.5




More information about the telepathy-commits mailing list