diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-10-11 17:38:11 -0400 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-10-11 17:45:42 -0400 |
commit | 8104691233d634225a8351e0feb8e42c6386c446 (patch) | |
tree | 427799a3beba94c363b0c8bf455312009554166d /telepathy-glib/util.c | |
parent | bdacfa26393e9c336638502e34aa8a19ec636fd3 (diff) | |
download | telepathy-glib-8104691233d634225a8351e0feb8e42c6386c446.tar.gz |
_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
Diffstat (limited to 'telepathy-glib/util.c')
-rw-r--r-- | 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 9f26c3ca7..068112db1 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)); } |