dovecot-2.0: maildir: Don't assert-crash if we're changing UIDs ...

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 10 20:17:27 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/f36fbaeddbf8
changeset: 9758:f36fbaeddbf8
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 10 13:17:21 2009 -0400
description:
maildir: Don't assert-crash if we're changing UIDs without saving mails.

diffstat:

1 file changed, 4 insertions(+), 2 deletions(-)
src/lib-storage/index/maildir/maildir-save.c |    6 ++++--

diffs (22 lines):

diff -r 1c01e6bf1090 -r f36fbaeddbf8 src/lib-storage/index/maildir/maildir-save.c
--- a/src/lib-storage/index/maildir/maildir-save.c	Sun Aug 09 22:00:30 2009 -0400
+++ b/src/lib-storage/index/maildir/maildir-save.c	Mon Aug 10 13:17:21 2009 -0400
@@ -712,14 +712,16 @@ maildir_save_set_recent_flags(struct mai
 	unsigned int i, count;
 	uint32_t uid;
 
+	uids = array_get(&saved_sorted_uids, &count);
+	if (count == 0)
+		return 0;
+
 	t_array_init(&saved_sorted_uids,
 		     array_count(&ctx->ctx.transaction->changes->saved_uids));
 	array_append_array(&saved_sorted_uids,
 			   &ctx->ctx.transaction->changes->saved_uids);
 	array_sort(&saved_sorted_uids, seq_range_cmp);
 
-	uids = array_get(&saved_sorted_uids, &count);
-	i_assert(count > 0);
 	for (i = 0; i < count; i++) {
 		for (uid = uids[i].seq1; uid <= uids[i].seq2; uid++)
 			index_mailbox_set_recent_uid(&mbox->ibox, uid);


More information about the dovecot-cvs mailing list