From e10cb0ac03a487f75188db10278174874e679deb Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Tue, 24 Jul 2001 19:47:56 +0000 Subject: Check if evolution_shell_client_get_local_storage returns 2001-07-24 Jon Trowbridge * gui/component/select-names/e-select-names.c (e_select_names_hookup_shell_listener): Check if evolution_shell_client_get_local_storage returns CORBA_OBJECT_NIL, which it should never do. If it does, print a warning in a dialog and try to recover w/o crashing. (Bug #5193) svn path=/trunk/; revision=11350 --- addressbook/ChangeLog | 8 ++++++++ addressbook/gui/component/select-names/e-select-names.c | 12 ++++++++++++ 2 files changed, 20 insertions(+) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 04ae3a90f1..50548e10db 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,11 @@ +2001-07-24 Jon Trowbridge + + * gui/component/select-names/e-select-names.c + (e_select_names_hookup_shell_listener): Check if + evolution_shell_client_get_local_storage returns CORBA_OBJECT_NIL, + which it should never do. If it does, print a warning in a dialog + and try to recover w/o crashing. (Bug #5193) + 2001-07-24 Dan Winship * backend/ebook/e-book-listener.c (e_book_listener_stop): Don't diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index 1004e510a5..9340bbce48 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include @@ -393,6 +395,16 @@ e_select_names_hookup_shell_listener (ESelectNames *e_select_names) listener = evolution_storage_listener_corba_objref(e_select_names->listener); + /* This should really never happen, but a bug report (ximian #5193) came in w/ a backtrace suggesting that it did in + fact happen to someone, so the best we can do is try to avoid crashing in this case. */ + if (storage == CORBA_OBJECT_NIL) { + GtkWidget *oh_shit; + + oh_shit = gnome_error_dialog (_("Unable to get local storage. This should never happen.")); + gtk_widget_show (oh_shit); + return; + } + gtk_signal_connect(GTK_OBJECT(e_select_names->listener), "new_folder", GTK_SIGNAL_FUNC(new_folder), e_select_names); gtk_signal_connect(GTK_OBJECT(e_select_names->listener), "update_folder", -- cgit v1.2.3