changeset 1366:b2005542fc93 HEAD

Don't crash if there's tree file hasn't been opened yet.
author Timo Sirainen <tss@iki.fi>
date Wed, 16 Apr 2003 18:38:11 +0300
parents 6f65cc862649
children 533bb936e674
files src/lib-index/maildir/maildir-rebuild.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/maildir/maildir-rebuild.c	Wed Apr 16 18:13:24 2003 +0300
+++ b/src/lib-index/maildir/maildir-rebuild.c	Wed Apr 16 18:38:11 2003 +0300
@@ -36,8 +36,10 @@
 	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))