changeset 15591:a7be0c9a00df

dsync: Crashfix for handling expunges from end of mailbox.
author Timo Sirainen <tss@iki.fi>
date Tue, 08 Jan 2013 05:23:06 +0200
parents ea3c1bd6d434
children 0949ddc3a892
files src/doveadm/dsync/dsync-mailbox-import.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/dsync/dsync-mailbox-import.c	Tue Jan 08 05:19:37 2013 +0200
+++ b/src/doveadm/dsync/dsync-mailbox-import.c	Tue Jan 08 05:23:06 2013 +0200
@@ -822,7 +822,8 @@
 		i_assert(change->uid <= importer->last_common_uid);
 		if (dsync_import_set_mail(importer, change))
 			mail_expunge(importer->mail);
-	} else if (change->uid < importer->cur_mail->uid) {
+	} else if (importer->cur_mail == NULL ||
+		   change->uid < importer->cur_mail->uid) {
 		/* already expunged locally, we can ignore this.
 		   uid=last_common_uid if we managed to verify from
 		   transaction log that the GUIDs match */