]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Don't assert-crash if expunge event handling finds that everything is...
authorTimo Sirainen <tss@iki.fi>
Fri, 24 Oct 2014 23:56:42 +0000 (02:56 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 24 Oct 2014 23:56:42 +0000 (02:56 +0300)
src/lib-index/mail-index-sync-update.c

index 44109b2068f44361567818703f923b10ca6539e5..2ad1aa640c02c57f58b3079da8622a4367ab99b5 100644 (file)
@@ -243,11 +243,14 @@ sync_expunge_range(struct mail_index_sync_map_ctx *ctx, const ARRAY_TYPE(seq_ran
        unsigned int i, count;
        uint32_t dest_seq1, prev_seq2, orig_rec_count;
 
+       range = array_get(seqs, &count);
+       if (count == 0)
+               return;
+       i_assert(count > 0);
+
        map = mail_index_sync_get_atomic_map(ctx);
 
        /* call the expunge handlers first */
-       range = array_get(seqs, &count);
-       i_assert(count > 0);
        if (sync_expunge_handlers_init(ctx)) {
                for (i = 0; i < count; i++) {
                        sync_expunge_call_handlers(ctx,