From: Vsevolod Stakhov Date: Sun, 23 Sep 2018 14:42:36 +0000 (+0100) Subject: [Minor] Check selectors result for nil X-Git-Tag: 1.8.0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69e72be7230fb349de39bcba7cebe70a563898d9;p=thirdparty%2Frspamd.git [Minor] Check selectors result for nil --- diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 6a4e0f2c4c..6a12d898a5 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -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, }