]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Don't crash if there's tree file hasn't been opened yet.
authorTimo Sirainen <tss@iki.fi>
Wed, 16 Apr 2003 15:38:11 +0000 (18:38 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 16 Apr 2003 15:38:11 +0000 (18:38 +0300)
--HG--
branch : HEAD

src/lib-index/maildir/maildir-rebuild.c

index 9c8f01040fc5859f6fc858dd27ffce74e7003f68..3adc269bce06d77cde926d174201502e0ebca01d 100644 (file)
@@ -36,8 +36,10 @@ int maildir_index_rebuild(struct mail_index *index)
        if (!mail_index_data_reset(index->data))
                return FALSE;
 
-       if (!mail_tree_reset(index->tree))
-               return FALSE;
+       if (index->tree != NULL) {
+               if (!mail_tree_reset(index->tree))
+                       return FALSE;
+       }
 
        /* read the mails by syncing */
        if (!index->sync_and_lock(index, MAIL_LOCK_UNLOCK, NULL))