]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Fix to mail_index_transaction_get_next_uid() fix.
authorTimo Sirainen <tss@iki.fi>
Thu, 22 Jan 2009 00:40:19 +0000 (19:40 -0500)
committerTimo Sirainen <tss@iki.fi>
Thu, 22 Jan 2009 00:40:19 +0000 (19:40 -0500)
--HG--
branch : HEAD

src/lib-index/mail-index-transaction.c

index 0a167c4ae18f87f7ea1e80768f2dac900b1943e7..e1015acf70ab969154dea9a6e313dfbbf92d93c6 100644 (file)
@@ -544,7 +544,7 @@ uint32_t mail_index_transaction_get_next_uid(struct mail_index_transaction *t)
        hdr = &t->view->map->hdr;
        next_uid = t->reset || head_hdr->uid_validity != hdr->uid_validity ?
                1 : hdr->next_uid;
-       if (array_is_created(&t->appends)) {
+       if (array_is_created(&t->appends) && t->highest_append_uid != 0) {
                /* get next_uid from appends if they have UIDs */
                i_assert(next_uid <= t->highest_append_uid);
                next_uid = t->highest_append_uid;