From a522668fe62f6369749f79f3348ad811e23187b7 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 12 Jun 2008 06:52:25 +0000 Subject: Check if there is a publish/subscribe list before adding/removing contacts from them. Fixes bug #537690. svn path=/trunk/; revision=1160 --- libempathy/empathy-tp-contact-list.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'libempathy/empathy-tp-contact-list.c') diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c index 93f81e8fd..685b13ef4 100644 --- a/libempathy/empathy-tp-contact-list.c +++ b/libempathy/empathy-tp-contact-list.c @@ -843,8 +843,11 @@ tp_contact_list_add (EmpathyContactList *list, g_return_if_fail (EMPATHY_IS_TP_CONTACT_LIST (list)); - empathy_tp_group_add_member (priv->subscribe, contact, message); - if (g_list_find (priv->pendings, contact)) { + if (priv->subscribe) { + empathy_tp_group_add_member (priv->subscribe, contact, message); + } + + if (priv->publish && g_list_find (priv->pendings, contact)) { empathy_tp_group_add_member (priv->publish, contact, message); } } @@ -858,8 +861,12 @@ tp_contact_list_remove (EmpathyContactList *list, g_return_if_fail (EMPATHY_IS_TP_CONTACT_LIST (list)); - empathy_tp_group_remove_member (priv->subscribe, contact, message); - empathy_tp_group_remove_member (priv->publish, contact, message); + if (priv->subscribe) { + empathy_tp_group_remove_member (priv->subscribe, contact, message); + } + if (priv->publish) { + empathy_tp_group_remove_member (priv->publish, contact, message); + } } static GList * -- cgit v1.2.3