]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Do not fail on empty history file
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 18 Jun 2018 13:51:07 +0000 (14:51 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 18 Jun 2018 13:51:07 +0000 (14:51 +0100)
src/libserver/roll_history.c

index 4d1d34bd9cdc2d2bb8bb3fbb96d4e2a477f2abc5..04f2da0c68daa99df760c50fcf739341df178df8 100644 (file)
@@ -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);