[empathy] EmpathyContact: don't crash if a contact doesn't have an account



commit a79f4193bb6958ebd620f437b0d786e4449d9eed
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Mon Jul 11 10:45:41 2011 +0100

    EmpathyContact: don't crash if a contact doesn't have an account
    
    https://bugzilla.gnome.org/show_bug.cgi?id=654256

 libempathy/empathy-contact.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index ed7af6c..16f1dc9 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -683,12 +683,15 @@ contact_is_tpl_entity (gpointer key,
 {
   EmpathyContact *contact = value;
   FindContactData *data = user_data;
+  TpAccount *account = empathy_contact_get_account (contact);
+  const gchar *path = NULL;
+
+  if (account != NULL)
+    path = tp_proxy_get_object_path (account);
 
   return !tp_strdiff (empathy_contact_get_id (contact),
               tpl_entity_get_identifier (data->entity)) &&
-         !tp_strdiff (tp_proxy_get_object_path (data->account),
-              tp_proxy_get_object_path (
-                  empathy_contact_get_account (contact)));
+         !tp_strdiff (tp_proxy_get_object_path (data->account), path);
 }
 
 EmpathyContact *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]