aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-12-15 02:15:57 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-12-15 04:39:53 +0800
commitca899cf1cbed85d333e19437512aab63dd866a0e (patch)
tree111b962dffbc7ed3850ad0b4f7425ee40a847f34 /shell
parentbaea9882fcc2c3056bf610b3df5077ddbfdee558 (diff)
downloadgsoc2013-evolution-ca899cf1cbed85d333e19437512aab63dd866a0e.tar
gsoc2013-evolution-ca899cf1cbed85d333e19437512aab63dd866a0e.tar.gz
gsoc2013-evolution-ca899cf1cbed85d333e19437512aab63dd866a0e.tar.bz2
gsoc2013-evolution-ca899cf1cbed85d333e19437512aab63dd866a0e.tar.lz
gsoc2013-evolution-ca899cf1cbed85d333e19437512aab63dd866a0e.tar.xz
gsoc2013-evolution-ca899cf1cbed85d333e19437512aab63dd866a0e.tar.zst
gsoc2013-evolution-ca899cf1cbed85d333e19437512aab63dd866a0e.zip
Make e_shell_window_update_search_menu() more crash-resistant.
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-window-actions.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c
index df96043076..03fa5379eb 100644
--- a/shell/e-shell-window-actions.c
+++ b/shell/e-shell-window-actions.c
@@ -2226,12 +2226,21 @@ e_shell_window_update_search_menu (EShellWindow *shell_window)
guint merge_id;
gint ii = 0;
+ g_return_if_fail (E_IS_SHELL_WINDOW (shell_window));
+
ui_manager = e_shell_window_get_ui_manager (shell_window);
view_name = e_shell_window_get_active_view (shell_window);
shell_view = e_shell_window_get_shell_view (shell_window, view_name);
+
+ /* Check for a NULL shell view before proceeding. This can
+ * happen if the initial view name from GConf is unrecognized.
+ * Without this we would crash at E_SHELL_VIEW_GET_CLASS(). */
+ g_return_if_fail (shell_view != NULL);
+
shell_content = e_shell_view_get_shell_content (shell_view);
context = e_shell_content_get_search_context (shell_content);
shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
+
source = E_FILTER_SOURCE_INCOMING;
/* Update sensitivity of search actions. */