From e3a4b93a1e7ec0fd3aa87818189bd87710645257 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 2 May 2011 20:27:13 +0200 Subject: Fix crash if contact_id is NULL when selecting its color --- libempathy-gtk/empathy-theme-adium.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libempathy-gtk/empathy-theme-adium.c') diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c index 66ce03316..5d4316095 100644 --- a/libempathy-gtk/empathy-theme-adium.c +++ b/libempathy-gtk/empathy-theme-adium.c @@ -416,9 +416,10 @@ theme_adium_append_html (EmpathyThemeAdium *theme, * Incoming/SenderColors.txt it will be used instead of * the default colors. */ - guint hash = g_str_hash (contact_id); - - replace = colors[hash % G_N_ELEMENTS (colors)]; + if (contact_id != NULL) { + guint hash = g_str_hash (contact_id); + replace = colors[hash % G_N_ELEMENTS (colors)]; + } } else if (theme_adium_match (&cur, "%senderStatusIcon%")) { /* FIXME: The path to the status icon of the sender * (available, away, etc...) -- cgit v1.2.3