diff options
author | Travis Reitter <travis.reitter@collabora.co.uk> | 2011-06-28 12:29:31 +0800 |
---|---|---|
committer | Jonny Lamb <jonnylamb@gnome.org> | 2011-08-22 17:36:33 +0800 |
commit | 2e4efa578faaebb0ef45606080d3586e8e2e739f (patch) | |
tree | be6a4f3ca052b9a803febc551956393b4c32248d | |
parent | d1d3a49fc919ed734b77a6e94afb2d49109182f2 (diff) | |
download | gsoc2013-empathy-2e4efa578faaebb0ef45606080d3586e8e2e739f.tar gsoc2013-empathy-2e4efa578faaebb0ef45606080d3586e8e2e739f.tar.gz gsoc2013-empathy-2e4efa578faaebb0ef45606080d3586e8e2e739f.tar.bz2 gsoc2013-empathy-2e4efa578faaebb0ef45606080d3586e8e2e739f.tar.lz gsoc2013-empathy-2e4efa578faaebb0ef45606080d3586e8e2e739f.tar.xz gsoc2013-empathy-2e4efa578faaebb0ef45606080d3586e8e2e739f.tar.zst gsoc2013-empathy-2e4efa578faaebb0ef45606080d3586e8e2e739f.zip |
Don't assume that all FolksIndividuals have a corresponding EmpathyContact.
Closes: bgo#653599 - Empathy shouldn't assume all TpfPersonas contain a
valid TpContact
Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
-rw-r--r-- | libempathy-gtk/empathy-individual-store.c | 39 | ||||
-rw-r--r-- | libempathy-gtk/empathy-individual-view.c | 3 |
2 files changed, 25 insertions, 17 deletions
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c index 4bdded80b..83ee67e9b 100644 --- a/libempathy-gtk/empathy-individual-store.c +++ b/libempathy-gtk/empathy-individual-store.c @@ -1431,25 +1431,28 @@ individual_store_contact_sort (FolksIndividual *individual_a, contact_a = empathy_contact_dup_from_folks_individual (individual_a); contact_b = empathy_contact_dup_from_folks_individual (individual_b); - account_a = empathy_contact_get_account (contact_a); - account_b = empathy_contact_get_account (contact_b); + if (contact_a != NULL && contact_b != NULL) + { + account_a = empathy_contact_get_account (contact_a); + account_b = empathy_contact_get_account (contact_b); - g_assert (account_a != NULL); - g_assert (account_b != NULL); + g_assert (account_a != NULL); + g_assert (account_b != NULL); - /* protocol */ - ret_val = g_strcmp0 (tp_account_get_protocol (account_a), - tp_account_get_protocol (account_b)); + /* protocol */ + ret_val = g_strcmp0 (tp_account_get_protocol (account_a), + tp_account_get_protocol (account_b)); - if (ret_val != 0) - goto out; + if (ret_val != 0) + goto out; - /* account ID */ - ret_val = g_strcmp0 (tp_proxy_get_object_path (account_a), - tp_proxy_get_object_path (account_b)); + /* account ID */ + ret_val = g_strcmp0 (tp_proxy_get_object_path (account_a), + tp_proxy_get_object_path (account_b)); - if (ret_val != 0) - goto out; + if (ret_val != 0) + goto out; + } /* identifier */ ret_val = g_utf8_collate (folks_individual_get_id (individual_a), @@ -2003,8 +2006,12 @@ individual_store_get_individual_status_icon_with_icon_name ( if (show_protocols_here) { contact = empathy_contact_dup_from_folks_individual (individual); - protocol_name = empathy_protocol_name_for_contact (contact); - icon_name = g_strdup_printf ("%s-%s", status_icon_name, protocol_name); + if (contact != NULL) + { + protocol_name = empathy_protocol_name_for_contact (contact); + icon_name = g_strdup_printf ("%s-%s", status_icon_name, + protocol_name); + } } else { diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index db63f0c0d..9d23027fc 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -692,7 +692,8 @@ individual_view_drag_motion (GtkWidget *widget, EmpathyContact *contact = NULL; contact = empathy_contact_dup_from_folks_individual (individual); - caps = empathy_contact_get_capabilities (contact); + if (contact != NULL) + caps = empathy_contact_get_capabilities (contact); tp_clear_object (&contact); } |