* Added a check in a g_object_ref, now it could happen that the object is NULL in...
authorSergio Villar Senin <svillar@igalia.com>
Mon, 17 Sep 2007 11:22:26 +0000 (11:22 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Mon, 17 Sep 2007 11:22:26 +0000 (11:22 +0000)
* Added a check in the new messages received, it could happen that the list is NULL when something wrong happens

pmo-trunk-r3315

src/modest-mail-operation.c
src/modest-ui-actions.c

index 5b38f54..f39bb84 100644 (file)
@@ -1433,7 +1433,8 @@ update_account_thread (gpointer thr_user_data)
        /* Frees */
        if (new_headers)
                g_object_unref (new_headers);
-       g_object_unref (all_folders);
+       if (all_folders)
+               g_object_unref (all_folders);
        g_object_unref (info->account);
        g_object_unref (info->transport_account);
        g_free (info->retrieve_type);
index 796ce29..8c55c56 100644 (file)
@@ -1530,6 +1530,11 @@ new_messages_arrived (ModestMailOperation *self,
        g_return_if_fail (MODEST_IS_MAIN_WINDOW (user_data));
        win = MODEST_MAIN_WINDOW (user_data);
 
+       /* Don't do anything if there are not new headers, this could
+          happen if there was any problem with the mail operation */
+       if (!new_headers)
+               return;
+
        /* Set contents style of headers view */
        if (modest_main_window_get_contents_style (win) == MODEST_MAIN_WINDOW_CONTENTS_STYLE_EMPTY) {
                folder_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW (win),