changeset 6667:b6c76ea86e2a HEAD

Assert-crashfix
author Timo Sirainen <tss@iki.fi>
date Sat, 03 Nov 2007 14:55:14 +0200
parents fc5e27a49c87
children 4a3cc2968040
files src/lib-index/mail-cache-transaction.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache-transaction.c	Sat Nov 03 12:10:36 2007 +0200
+++ b/src/lib-index/mail-cache-transaction.c	Sat Nov 03 14:55:14 2007 +0200
@@ -791,7 +791,7 @@
 	}
 
 	file_field = ctx->cache->field_file_map[field_idx];
-	if (file_field == (uint32_t)-1) {
+	if (MAIL_CACHE_IS_UNUSABLE(ctx->cache) || file_field == (uint32_t)-1) {
 		/* we'll have to add this field to headers */
 		if (mail_cache_header_add_field(ctx, field_idx) < 0)
 			return;
@@ -799,6 +799,7 @@
 		file_field = ctx->cache->field_file_map[field_idx];
 		i_assert(file_field != (uint32_t)-1);
 	}
+	i_assert(ctx->cache_file_seq != 0);
 
 	mail_cache_decision_add(ctx->view, seq, field_idx);