From 0bb5930abfa451f72e0652acb6282c500c39f1ac Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 25 Feb 2021 12:42:38 +0000 Subject: [PATCH] [Fix] Selectors: Properly fix implicit tostring for nils --- lualib/lua_selectors/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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' -- 2.39.5