aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/message-list.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index 68e05fc998..fc1d6896a6 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -4401,10 +4401,18 @@ ml_sort_uids_by_tree (MessageList *ml, GPtrArray *uids)
for (i = 0; i < uids->len; i++) {
gchar *uid;
- struct sort_message_info_data *md = g_new0 (struct sort_message_info_data, 1);
+ CamelMessageInfo *mi;
+ struct sort_message_info_data *md;
uid = g_ptr_array_index (uids, i);
- md->mi = camel_folder_get_message_info (ml->folder, uid);
+ mi = camel_folder_get_message_info (ml->folder, uid);
+ if (!mi) {
+ g_warning ("%s: Cannot find uid '%s' in folder '%s'", G_STRFUNC, uid, camel_folder_get_full_name (ml->folder));
+ continue;
+ }
+
+ md = g_new0 (struct sort_message_info_data, 1);
+ md->mi = mi;
md->values = g_ptr_array_sized_new (len);
g_hash_table_insert (sort_data.message_infos, uid, md);