From: Mikhail Galanin Date: Thu, 20 Sep 2018 08:41:36 +0000 (+0100) Subject: [Minor] logical error, get_variable() accepts either one or two arguments X-Git-Tag: 1.8.0~58^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ca61c951dcdac1093b3b507dd42c94b5363ff701;p=rspamd.git [Minor] logical error, get_variable() accepts either one or two arguments When second argument is nil it still considered as two arguments call, however 2nd one is expected to be string. --- diff --git a/lualib/lua_selectors.lua b/lualib/lua_selectors.lua index d93b11df6..983f28589 100644 --- a/lualib/lua_selectors.lua +++ b/lualib/lua_selectors.lua @@ -244,7 +244,8 @@ e.g. `get_user`]], -- the second argument is optional and defines the type (string by default) ['pool_var'] = { ['get_value'] = function(task, args) - return task:get_mempool():get_variable(args[1], args[2]),(args[2] or 'string') + local type = args[2] or 'string' + return task:get_mempool():get_variable(args[1], type),(type) end, ['description'] = [[Get specific pool var. The first argument must be variable name, the second argument is optional and defines the type (string by default)]],