2007-07-09 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Mon, 9 Jul 2007 21:26:20 +0000 (21:26 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Mon, 9 Jul 2007 21:26:20 +0000 (21:26 +0000)
* src/modest-ui-actions.c: (modest_ui_actions_on_send_receive):
Do not try to unref a NULL folder store, to avoid a runtime warning.
This seems to happen sometimes when changing accounts settings.

pmo-trunk-r2659

ChangeLog2
src/modest-ui-actions.c

index 5f3ea22..84fe310 100644 (file)
@@ -1,5 +1,11 @@
 2007-07-09  Murray Cumming  <murrayc@murrayc.com>
 
+       * src/modest-ui-actions.c: (modest_ui_actions_on_send_receive):
+       Do not try to unref a NULL folder store, to avoid a runtime warning.
+       This seems to happen sometimes when changing accounts settings.
+
+2007-07-09  Murray Cumming  <murrayc@murrayc.com>
+
        * src/modest-tny-account-store.c:
        (modest_tny_account_store_instance_init),
        (modest_tny_account_store_finalize),
index c398167..4710014 100644 (file)
@@ -1487,7 +1487,7 @@ modest_ui_actions_on_send_receive (GtkAction *action,  ModestWindow *win)
 
                folder_store = modest_folder_view_get_selected (MODEST_FOLDER_VIEW (folder_view));
 
-               if (TNY_IS_FOLDER (folder_store)) {
+               if (folder_store && TNY_IS_FOLDER (folder_store)) {
                        header_view = 
                                modest_main_window_get_child_widget (MODEST_MAIN_WINDOW (win),
                                                                     MODEST_WIDGET_TYPE_HEADER_VIEW);
@@ -1501,7 +1501,9 @@ modest_ui_actions_on_send_receive (GtkAction *action,  ModestWindow *win)
                                                       folder_refreshed_cb,
                                                       MODEST_MAIN_WINDOW (win));
                }
-               g_object_unref (folder_store);
+               
+               if (folder_store)
+                       g_object_unref (folder_store);
        }
        
        /* Refresh the active account */