From 01086a035fcf1b128bd9547219aa00c8768e0118 Mon Sep 17 00:00:00 2001 From: Cosimo Alfarano Date: Wed, 31 Aug 2011 17:28:35 +0100 Subject: Fixes a segfault in empathy-individual-store.c When a contact cannot be obtained from an individual, icon_name and contact will be NULL, leading to g_hash_table_lookup for a NULL-value, segfaulting. Although there's probably an underlying error somewhere, the NULL case should be handled, being a valid return value for the method; https://bugzilla.gnome.org/show_bug.cgi?id=657914 --- libempathy-gtk/empathy-individual-store.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c index 74c3a1452..d21a9d50b 100644 --- a/libempathy-gtk/empathy-individual-store.c +++ b/libempathy-gtk/empathy-individual-store.c @@ -2033,6 +2033,14 @@ individual_store_get_individual_status_icon_with_icon_name ( icon_name = g_strdup_printf ("%s-%s", status_icon_name, protocol_name); } + else + { + g_warning ("Cannot retrieve contact from individual '%s'", + folks_alias_details_get_alias ( + FOLKS_ALIAS_DETAILS (individual))); + + return NULL; + } } else { -- cgit v1.2.3