diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-18 14:51:07 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-18 14:51:07 +0100 |
commit | d4f85c4197a01df4a79e2952af90dec1769daff1 (patch) | |
tree | 3792bd29eb9485e0e89a9a7b20e85accdf5f23f2 /src | |
parent | 8d393a012f52e57ab6bc7cc0c8da0c64ccd10ea9 (diff) | |
download | rspamd-d4f85c4197a01df4a79e2952af90dec1769daff1.tar.gz rspamd-d4f85c4197a01df4a79e2952af90dec1769daff1.zip |
[Minor] Do not fail on empty history file
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/roll_history.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); |