changeset 13299:0b99dd56ebb1

stats plugin: Don't crash if stats collecting is disabled.
author Timo Sirainen <tss@iki.fi>
date Sun, 28 Aug 2011 05:49:36 +0300
parents 58bfb3744ccc
children 9fa11cecd8c8
files src/plugins/stats/stats-plugin.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/stats/stats-plugin.c	Sun Aug 28 05:49:06 2011 +0300
+++ b/src/plugins/stats/stats-plugin.c	Sun Aug 28 05:49:36 2011 +0300
@@ -224,6 +224,10 @@
 {
 	struct mailbox_vfuncs *v = box->vlast;
 	struct stats_mailbox *sbox;
+	struct stats_user *suser = STATS_USER_CONTEXT(box->storage->user);
+
+	if (suser == NULL)
+		return;
 
 	sbox = p_new(box->pool, struct stats_mailbox, 1);
 	sbox->module_ctx.super = *v;