[empathy] Fix crash if contact_id is NULL when selecting its color
- From: Xavier Claessens <xclaesse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Fix crash if contact_id is NULL when selecting its color
- Date: Mon, 2 May 2011 18:27:41 +0000 (UTC)
commit e3a4b93a1e7ec0fd3aa87818189bd87710645257
Author: Xavier Claessens <xclaesse gmail com>
Date: Mon May 2 20:27:13 2011 +0200
Fix crash if contact_id is NULL when selecting its color
libempathy-gtk/empathy-theme-adium.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 66ce033..5d43160 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...)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]