[empathy/gnome-3-4] Fix crash when displaying google account vcard



commit d015077538b66554ed75194a47446b84d8081769
Author: Xavier Claessens <xavier claessens collabora co uk>
Date:   Tue May 7 15:37:32 2013 +0200

    Fix crash when displaying google account vcard

 libempathy-gtk/empathy-contact-widget.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 5691891..8a47a3c 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -342,6 +342,17 @@ contact_widget_details_update_edit (EmpathyContactWidget *information)
     {
       TpContactInfoField *field = l->data;
 
+      /* For some reason it can happen that the vCard contains fields the CM
+       * claims to be not supported. This is a workaround for gabble bug
+       * https://bugs.freedesktop.org/show_bug.cgi?id=64319. But we shouldn't
+       * crash on buggy CM anyway. */
+       if (get_spec_from_list (specs, field->field_name) == NULL)
+         {
+           DEBUG ("Buggy CM: self's vCard contains %s field but it is not in "
+               "Connection' supported fields", field->field_name);
+           continue;
+         }
+
       /* make a copy for the details_to_set list */
       field = tp_contact_info_field_copy (field);
       DEBUG ("Field %s is in our vCard", field->field_name);


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