From cb062bf2f46a5906bc1f9a0c65f1978d97e7b35c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 20 Nov 2013 00:17:15 +0000 Subject: [PATCH] Check type of rule in multimap module. --- src/plugins/lua/multimap.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index a7008b82f..33ad35a2c 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -282,13 +282,17 @@ end local opts = rspamd_config:get_all_opt('multimap') if opts and type(opts) == 'table' then for k,m in pairs(opts) do - local rule = add_multimap_rule(k, m) - if not rule then - rspamd_logger.err('cannot add rule: "'..k..'"') - else - if type(rspamd_config.get_api_version) ~= 'nil' then - rspamd_config:register_virtual_symbol(m['symbol'], 1.0) + if type(m) == 'table' then + local rule = add_multimap_rule(k, m) + if not rule then + rspamd_logger.err('cannot add rule: "'..k..'"') + else + if type(rspamd_config.get_api_version) ~= 'nil' then + rspamd_config:register_virtual_symbol(m['symbol'], 1.0) + end end + else + rspamd_logger.err('parameter ' .. k .. ' is invalid, must be an object') end end -- add fake symbol to check all maps inside a single callback -- 2.39.5