From 69e72be7230fb349de39bcba7cebe70a563898d9 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 23 Sep 2018 15:42:36 +0100 Subject: [PATCH] [Minor] Check selectors result for nil --- src/plugins/lua/multimap.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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, } -- 2.47.3