summaryrefslogtreecommitdiff
path: root/telepathy-glib/presence-mixin.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2009-05-18 13:51:11 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2009-05-18 13:57:13 +0100
commit86aa65710e35469edccf6a6347c78f62769b94a4 (patch)
treeef31c7e26342fbfd27693ff325b83e1b35b27568 /telepathy-glib/presence-mixin.c
parentd93c9fc88c701dae9db25d3cd5d12fae10f521be (diff)
downloadtelepathy-glib-86aa65710e35469edccf6a6347c78f62769b94a4.tar.gz
Don't assert if get_contact_statuses returns NULL
Fixes fd.o#21792
Diffstat (limited to 'telepathy-glib/presence-mixin.c')
-rw-r--r--telepathy-glib/presence-mixin.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/telepathy-glib/presence-mixin.c b/telepathy-glib/presence-mixin.c
index f95b9339a..b2b4f9b85 100644
--- a/telepathy-glib/presence-mixin.c
+++ b/telepathy-glib/presence-mixin.c
@@ -1396,19 +1396,26 @@ tp_presence_mixin_simple_presence_fill_contact_attributes (GObject *obj,
{
TpPresenceMixinClass *mixin_cls =
TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj));
- struct _i_absolutely_love_g_hash_table_foreach data = {
- mixin_cls->statuses, NULL, attributes_hash };
GHashTable *contact_statuses;
+ GError *error = NULL;
- contact_statuses = mixin_cls->get_contact_statuses (obj, contacts, NULL);
+ contact_statuses = mixin_cls->get_contact_statuses (obj, contacts, &error);
- g_assert (contact_statuses != NULL);
+ if (contact_statuses == NULL)
+ {
+ DEBUG ("get_contact_statuses failed: %s", error->message);
+ g_error_free (error);
+ }
+ else
+ {
+ struct _i_absolutely_love_g_hash_table_foreach data = {
+ mixin_cls->statuses, contact_statuses, attributes_hash };
- data.contact_statuses = contact_statuses;
- g_hash_table_foreach (contact_statuses,
- simple_presence_fill_contact_attributes_foreach, &data);
+ g_hash_table_foreach (contact_statuses,
+ simple_presence_fill_contact_attributes_foreach, &data);
- g_hash_table_destroy (contact_statuses);
+ g_hash_table_destroy (contact_statuses);
+ }
}
/**