]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Avoid extra has_symbol call
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 9 Apr 2021 18:27:29 +0000 (19:27 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 9 Apr 2021 18:27:29 +0000 (19:27 +0100)
src/plugins/lua/phishing.lua

index ed6ffe3bd901502015f15f3ea0dd098e1015a5fa..86b1d440b5c20e1ea1d3991641b5442f6e7be545 100644 (file)
@@ -183,8 +183,9 @@ local function phishing_cb(task)
 
   -- Process all urls
   local dmarc_dom
-  if task:has_symbol('DMARC_POLICY_ALLOW') then
-    local dsym = task:get_symbol('DMARC_POLICY_ALLOW')[1]
+  local dsym = task:get_symbol('DMARC_POLICY_ALLOW')
+  if dsym then
+    dsym = dsym[1] -- legacy stuff, need to take the first element
     dmarc_dom = dsym.options[1]
   end