From d13d05202985ca4da31fcfbcdc422e9eeee0b055 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 13 Jul 2007 09:15:50 +0000 Subject: [PATCH] 2007-07-13 Murray Cumming * src/modest-ui-dimming-rules.c: (_selected_folder_is_root): Fix my previous commit, to avoid unrefing a NULL TnyFolderStore. pmo-trunk-r2733 --- ChangeLog2 | 5 +++++ src/modest-ui-dimming-rules.c | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog2 b/ChangeLog2 index c5885da..e13bce3 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,3 +1,8 @@ +2007-07-13 Murray Cumming + + * src/modest-ui-dimming-rules.c: (_selected_folder_is_root): + Fix my previous commit, to avoid unrefing a NULL TnyFolderStore. + 2007-07-12 Armin Burgmeier * src/maemo/modest-main-window.c: Make default account appear bold diff --git a/src/modest-ui-dimming-rules.c b/src/modest-ui-dimming-rules.c index 66ee5db..486ef45 100644 --- a/src/modest-ui-dimming-rules.c +++ b/src/modest-ui-dimming-rules.c @@ -1167,12 +1167,15 @@ _selected_folder_is_root (ModestMainWindow *win) /* All accounts are root items: */ GtkWidget *folder_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW(win), MODEST_WIDGET_TYPE_FOLDER_VIEW); - if (folder_view) { + if (folder_view) { + gboolean is_account = FALSE; TnyFolderStore *folder_store = modest_folder_view_get_selected (MODEST_FOLDER_VIEW(folder_view)); - const gboolean is_account = TNY_IS_ACCOUNT (folder_store); - g_object_unref (folder_store); - folder_store = NULL; + if (folder_store) { + is_account = TNY_IS_ACCOUNT (folder_store); + g_object_unref (folder_store); + folder_store = NULL; + } if (is_account) return TRUE; -- 1.7.9.5