From d4f85c4197a01df4a79e2952af90dec1769daff1 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 18 Jun 2018 14:51:07 +0100 Subject: [PATCH] [Minor] Do not fail on empty history file --- src/libserver/roll_history.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libserver/roll_history.c b/src/libserver/roll_history.c index 4d1d34bd9..04f2da0c6 100644 --- a/src/libserver/roll_history.c +++ b/src/libserver/roll_history.c @@ -236,7 +236,11 @@ rspamd_roll_history_load (struct roll_history *history, const gchar *filename) ucl_parser_free (parser); close (fd); - g_assert (top != NULL); + if (top == NULL) { + msg_warn ("cannot parse history file %s: no object", filename); + + return FALSE; + } if (ucl_object_type (top) != UCL_ARRAY) { msg_warn ("invalid object type read from: %s", filename); -- 2.39.5