]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Check selectors result for nil
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 23 Sep 2018 14:42:36 +0000 (15:42 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 23 Sep 2018 14:42:36 +0000 (15:42 +0100)
src/plugins/lua/multimap.lua

index 6a4e0f2c4cd5abf9fa9d5874d745b45f0d3b3e99..6a12d898a5b884ca332d7d2e3a3361e9f49d8bbf 100644 (file)
@@ -850,12 +850,14 @@ local function multimap_callback(task, rule)
     selector = function()
       local elts = rule.selector(task)
 
-      if type(elts) == 'table' then
-        for _,elt in ipairs(elts) do
-          match_rule(rule, elt)
+      if elts then
+        if type(elts) == 'table' then
+          for _,elt in ipairs(elts) do
+            match_rule(rule, elt)
+          end
+        else
+          match_rule(rule, elts)
         end
-      else
-        match_rule(rule, elts)
       end
     end,
   }