From 6ed1fa481c3ecd08d028074903be4945fa048cca Mon Sep 17 00:00:00 2001
From: Yuriy Vostrikov <vostrikov@corp.mail.ru>
Date: Mon, 24 Jan 2011 17:13:37 +0300
Subject: [PATCH] [core] Do not SEGV if no statitics collected.

---
 core/stat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/core/stat.c b/core/stat.c
index 85fd40f996..762578bcb4 100644
--- a/core/stat.c
+++ b/core/stat.c
@@ -108,6 +108,9 @@ stat_print(struct tbuf *buf)
 void
 stat_age(ev_timer *timer, int events __unused__)
 {
+	if (stats == NULL)
+		return;
+
 	for (int i = 0; i <= stats_max; i++) {
 		if (stats[i].name == NULL)
 			continue;
-- 
GitLab