From: Alexander Moisseev Date: Sun, 4 Dec 2016 17:06:45 +0000 (+0300) Subject: [Minor] Fix condition, avoid `nil` index X-Git-Tag: 1.4.2~11^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=19bb251673220aeda160a6466cf98f720f4463d5;p=rspamd.git [Minor] Fix condition, avoid `nil` index --- diff --git a/rules/misc.lua b/rules/misc.lua index dd2ead132..0610f126d 100644 --- a/rules/misc.lua +++ b/rules/misc.lua @@ -640,10 +640,12 @@ local check_replyto_id = rspamd_config:register_callback_symbol('CHECK_REPLYTO', -- See if From and Reply-To addresses match if (from[1].addr:lower() == rt[1].addr:lower()) then task:insert_result('REPLYTO_ADDR_EQ_FROM', 1.0) - elseif (from[1].domain:lower() == rt[1].addr:lower()) then - task:insert_result('REPLYTO_DOM_EQ_FROM_DOM', 1.0) - elseif (from[1].domain:lower() ~= rt[1].domain:lower()) then - task:insert_result('REPLYTO_DOM_NEQ_FROM_DOM', 1.0) + elseif from[1].domain and rt[1].domain then + if (from[1].domain:lower() == rt[1].domain:lower()) then + task:insert_result('REPLYTO_DOM_EQ_FROM_DOM', 1.0) + else + task:insert_result('REPLYTO_DOM_NEQ_FROM_DOM', 1.0) + end end -- See if the Display Names match if (from[1].name and rt[1].name and from[1].name:lower() == rt[1].name:lower()) then