From d7da417d4360ca0e0a1305dc5552a95da8e9dfec Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 29 Jul 2016 17:10:44 +0100 Subject: [PATCH] [Fix] Filter NaN from scores in history --- src/controller.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/controller.c b/src/controller.c index 394110d0a..b77d4e771 100644 --- a/src/controller.c +++ b/src/controller.c @@ -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, -- 2.39.5