From b9fc03d9f989768f1f825ea04a5168d8a89a86ef Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Mon, 28 Nov 2016 12:32:01 +0200 Subject: [PATCH] [Minor] Avoid nil index --- rules/misc.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules/misc.lua b/rules/misc.lua index 7fbd9cf1a..f7b63d3c8 100644 --- a/rules/misc.lua +++ b/rules/misc.lua @@ -498,7 +498,8 @@ local check_from_id = rspamd_config:register_callback_symbol('CHECK_FROM', 1.0, -- Check if FROM == TO if (#to == 1 and to[1].addr:lower() == from[1].addr:lower()) then task:insert_result('TO_EQ_FROM', 1.0) - elseif (#to == 1 and to[1].domain:lower() == from[1].domain:lower()) then + elseif (#to == 1 and to[1].domain and from[1].domain and + to[1].domain:lower() == from[1].domain:lower()) then task:insert_result('TO_DOM_EQ_FROM_DOM', 1.0) end end -- 2.39.5