changeset 7673:fd29c90047e9 HEAD

Don't crash if there are no extensions.
author Timo Sirainen <tss@iki.fi>
date Wed, 13 Feb 2008 18:06:02 +0200
parents 74e1dc23e441
children 5e3c1fde2f78
files src/util/idxview.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/util/idxview.c	Tue Feb 12 12:12:50 2008 +0200
+++ b/src/util/idxview.c	Wed Feb 13 18:06:02 2008 +0200
@@ -100,7 +100,10 @@
 	const struct mail_index_ext *extensions;
 	unsigned int i, count;
 
-	extensions = array_get(&index->map->extensions, &count);
+	if (array_is_created(&index->map->extensions))
+		extensions = array_get(&index->map->extensions, &count);
+	else
+		count = 0;
 	if (count == 0) {
 		printf("no extensions\n");
 		return;