]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Filter NaN from scores in history
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 29 Jul 2016 16:10:44 +0000 (17:10 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 29 Jul 2016 16:10:44 +0000 (17:10 +0100)
src/controller.c

index 394110d0ad5c3ead4dadc35856c2c8a05a4cc6b8..b77d4e77197b42d1c2b9230ca3cba2c1cb159f6c 100644 (file)
@@ -1275,8 +1275,15 @@ rspamd_controller_handle_history (struct rspamd_http_connection_entry *conn_ent,
                        ucl_object_insert_key (obj,
                                ucl_object_fromstring (rspamd_action_to_str (
                                        row->action)), "action", 0, false);
-                       ucl_object_insert_key (obj, ucl_object_fromdouble (
-                                       row->score),              "score",                      0, false);
+
+                       if (!isnan (row->score)) {
+                               ucl_object_insert_key (obj, ucl_object_fromdouble (
+                                               row->score),              "score",                      0, false);
+                       }
+                       else {
+                               ucl_object_insert_key (obj,
+                                               ucl_object_fromdouble (0.0), "score", 0, false);
+                       }
 
                        if (!isnan (row->required_score)) {
                                ucl_object_insert_key (obj,