From: Vsevolod Stakhov Date: Mon, 18 Jun 2018 13:51:07 +0000 (+0100) Subject: [Minor] Do not fail on empty history file X-Git-Tag: 1.7.7~90 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d4f85c4197a01df4a79e2952af90dec1769daff1;p=thirdparty%2Frspamd.git [Minor] Do not fail on empty history file --- diff --git a/src/libserver/roll_history.c b/src/libserver/roll_history.c index 4d1d34bd9c..04f2da0c68 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);