[evolution] Bug 637091 - Crash in g_str_hash, task_shell_sidebar_client_removed



commit 0be641ea82d61a5967d4f34dde9bc3bbbb9aa7cf
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Mar 3 07:45:37 2011 -0500

    Bug 637091 - Crash in g_str_hash, task_shell_sidebar_client_removed
    
    I don't know how in the world an ESource can wind up not having a UID
    string, but we saw a case of this in 2.32.  Emit a runtime warning and
    avoid crashing.

 modules/calendar/e-cal-shell-sidebar.c  |    1 +
 modules/calendar/e-memo-shell-sidebar.c |    1 +
 modules/calendar/e-task-shell-sidebar.c |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index be0a344..21c630b 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -746,6 +746,7 @@ cal_shell_sidebar_client_removed (ECalShellSidebar *cal_shell_sidebar,
 
 	source = e_cal_get_source (client);
 	uid = e_source_peek_uid (source);
+	g_return_if_fail (uid != NULL);
 
 	g_hash_table_remove (client_table, uid);
 	e_source_selector_unselect_source (selector, source);
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index 612b831..4c9e254 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -651,6 +651,7 @@ memo_shell_sidebar_client_removed (EMemoShellSidebar *memo_shell_sidebar,
 
 	source = e_cal_get_source (client);
 	uid = e_source_peek_uid (source);
+	g_return_if_fail (uid != NULL);
 
 	g_hash_table_remove (client_table, uid);
 	e_source_selector_unselect_source (selector, source);
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index c6f6e15..99df3b6 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -651,6 +651,7 @@ task_shell_sidebar_client_removed (ETaskShellSidebar *task_shell_sidebar,
 
 	source = e_cal_get_source (client);
 	uid = e_source_peek_uid (source);
+	g_return_if_fail (uid != NULL);
 
 	g_hash_table_remove (client_table, uid);
 	e_source_selector_unselect_source (selector, source);



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