Index: camel/ChangeLog
===================================================================
--- camel/ChangeLog	(revision 7896)
+++ camel/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2007-07-30  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #324008
+
+	* camel-text-index.c: (text_index_sync):
+	Don't sync when wasn't created successfully.
+
 2007-07-28  Ross Burton  <ross@openedhand.com>
 
 	* camel-index.c:
Index: camel/camel-text-index.c
===================================================================
--- camel/camel-text-index.c	(revision 7896)
+++ camel/camel-text-index.c	(working copy)
@@ -263,7 +263,9 @@
 
 	d(printf("sync: blocks = %p\n", p->blocks));
 
-	if (p->blocks == NULL)
+	if (p->blocks == NULL || p->links == NULL
+	    || p->word_index == NULL || p->word_hash == NULL
+	    || p->name_index == NULL || p->name_hash == NULL)
 		return 0;
 
 	rb = (struct _CamelTextIndexRoot *)p->blocks->root;
