aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-02-25 12:42:38 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-02-25 12:42:38 +0000
commit0bb5930abfa451f72e0652acb6282c500c39f1ac (patch)
tree771c18c78567af7d9250cfe260df7d28a53c7cc0 /lualib
parent8fe0974de537d25bf60637c9ff2d6463eca660b4 (diff)
downloadrspamd-0bb5930abfa451f72e0652acb6282c500c39f1ac.tar.gz
rspamd-0bb5930abfa451f72e0652acb6282c500c39f1ac.zip
[Fix] Selectors: Properly fix implicit tostring for nils
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_selectors/init.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lualib/lua_selectors/init.lua b/lualib/lua_selectors/init.lua
index cc44d0b01..e971e14c3 100644
--- a/lualib/lua_selectors/init.lua
+++ b/lualib/lua_selectors/init.lua
@@ -64,9 +64,11 @@ local function implicit_tostring(t, ud_or_table)
else
return tostring(ud_or_table),'string'
end
- else
+ elseif t ~= 'nil' then
return tostring(ud_or_table),'string'
end
+
+ return nil
end
local function process_selector(task, sel)
@@ -350,6 +352,8 @@ exports.parse_selector = function(cfg, str)
end
local ret_type = type(ret)
+
+ if ret_type == 'nil' then return nil end
-- Now apply types heuristic
if ret_type == 'string' then
return ret,'string'