From 8104691233d634225a8351e0feb8e42c6386c446 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 11 Oct 2011 17:38:11 -0400 Subject: [PATCH] _tp_contacts_from_values: skip NULL contacts dup_owners_table() can insert NULL contacts into the hash (if the owner is unknown) so we should just ignore those. https://bugs.freedesktop.org/show_bug.cgi?id=41697 --- telepathy-glib/util.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/telepathy-glib/util.c b/telepathy-glib/util.c index 9f26c3c..068112d 100644 --- a/telepathy-glib/util.c +++ b/telepathy-glib/util.c @@ -2009,7 +2009,7 @@ _tp_contacts_to_handles (TpConnection *connection, } /* table's key can be anything (usually TpHandle) but value must be a - * GObject (usually TpContact) */ + * TpContact */ GPtrArray * _tp_contacts_from_values (GHashTable *table) { @@ -2026,7 +2026,10 @@ _tp_contacts_from_values (GHashTable *table) g_hash_table_iter_init (&iter, table); while (g_hash_table_iter_next (&iter, NULL, &value)) { - g_assert (G_IS_OBJECT (value)); + if (value == NULL) + continue; + g_assert (TP_IS_CONTACT (value)); + g_ptr_array_add (contacts, g_object_ref (value)); } -- 1.7.4.1