[empathy] Fixes a segfault in empathy-individual-store.c



commit 01086a035fcf1b128bd9547219aa00c8768e0118
Author: Cosimo Alfarano <cosimo alfarano collabora co uk>
Date:   Wed Aug 31 17:28:35 2011 +0100

    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 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index 74c3a14..d21a9d5 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
     {



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