changeset 510:9d4c71bfaed9 HEAD

Don't crash either if expunge or update_flags sync_callbacks haven't been set when syncing modify log
author Timo Sirainen <tss@iki.fi>
date Fri, 25 Oct 2002 05:52:02 +0300
parents 48910084a8ce
children 10d6c1cb6511
files src/lib-storage/index/index-sync.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-sync.c	Fri Oct 25 05:31:19 2002 +0300
+++ b/src/lib-storage/index/index-sync.c	Fri Oct 25 05:52:02 2002 +0300
@@ -111,6 +111,9 @@
 			seq_count = (log->seq2 - log->seq1) + 1;
 			messages -= seq_count;
 
+			if (sc->expunge == NULL)
+				break;
+
 			for (; seq_count > 0; seq_count--) {
 				sc->expunge(&ibox->box, log->seq1,
 					    sc_context);
@@ -133,6 +136,11 @@
 	messages = first_flag_messages_count;
 	custom_flags = mail_custom_flags_list_get(ibox->index->custom_flags);
 
+	if (sc->update_flags == NULL) {
+		/* don't bother going through, we're not printing them anyway */
+		total_count = 0;
+	}
+
 	log = first_flag_log;
 	for (i = first_flag_change; i < total_count; i++, log++) {
 		if (i == count1)