From dde092ef09cddfae6bd1d70977d5208bb88d2d7f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 19 Jul 2021 10:23:44 +0100 Subject: [Minor] Fix checks safety --- rules/html.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'rules') diff --git a/rules/html.lua b/rules/html.lua index 97a6b2372..58fabfd7a 100644 --- a/rules/html.lua +++ b/rules/html.lua @@ -214,10 +214,12 @@ local vis_check_id = rspamd_config:register_symbol{ local tr = transp_len / (normal_len + transp_len) if tr > transp_rate then transp_rate = tr + if not bl.color then bl.color = {0, 0, 0} end + if not bl.bgcolor then bl.bgcolor = {0, 0, 0} end arg = string.format('%s color #%x%x%x bgcolor #%x%x%x', tag:get_type(), - bl.color[1] or 0, bl.color[2] or 0, bl.color[3] or 0, - bl.bgcolor[1] or 0, bl.bgcolor[2] or 0, bl.bgcolor[3] or 0) + bl.color[1], bl.color[2], bl.color[3], + bl.bgcolor[1], bl.bgcolor[2], bl.bgcolor[3]) end end end -- cgit v1.2.3