]> source.dussan.org Git - rspamd.git/commitdiff
fix potential error if fdtld and mdtld == nil
authorLionel <lionel.prat9@gmail.com>
Tue, 6 Oct 2020 17:12:31 +0000 (19:12 +0200)
committerGitHub <noreply@github.com>
Tue, 6 Oct 2020 17:12:31 +0000 (19:12 +0200)
rules/mid.lua

index 68a15136c016bb253783d0ada3be0f036e016265..a7ffb27e1a381817c59f62b273daff4774dd3a28 100644 (file)
@@ -53,7 +53,7 @@ local function mid_check_func(task)
       task:insert_result('MID_CONTAINS_FROM', 1.0)
     elseif (md and fd == md:lower()) then
       task:insert_result('MID_RHS_MATCH_FROM', 1.0)
-    elseif (md and mdtld:lower() == fdtld) then
+    elseif (mdtld ~= nil and fdtld ~= nil and mdtld:lower() == fdtld) then
       task:insert_result('MID_RHS_MATCH_FROMTLD', 1.0)
     end
   end