* Added a check in the new messages received, it could happen that the list is NULL when something wrong happens
pmo-trunk-r3315
/* 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);
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),