diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-06 09:36:00 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-06 09:36:00 +0100 |
commit | 3c918d26c6692e3f8abd524adf751fdf0d36ff62 (patch) | |
tree | 5c73f724897e448b96a64d7c9b6bad218c3b4bd5 /lualib/lua_redis.lua | |
parent | b4b158a4de88a2961bd62a3297c74f495a25de1a (diff) | |
download | rspamd-3c918d26c6692e3f8abd524adf751fdf0d36ff62.tar.gz rspamd-3c918d26c6692e3f8abd524adf751fdf0d36ff62.zip |
[Minor] Allow to work without rspamd_config object
Diffstat (limited to 'lualib/lua_redis.lua')
-rw-r--r-- | lualib/lua_redis.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua index a93545f23..941ac383a 100644 --- a/lualib/lua_redis.lua +++ b/lualib/lua_redis.lua @@ -310,16 +310,18 @@ local function process_redis_opts(options, redis_params) end local function enrich_defaults(rspamd_config, module, redis_params) - local opts = rspamd_config:get_all_opt('redis') + if rspamd_config then + local opts = rspamd_config:get_all_opt('redis') - if opts then - if module then - if opts[module] then - process_redis_opts(opts[module], redis_params) + if opts then + if module then + if opts[module] then + process_redis_opts(opts[module], redis_params) + end end - end - process_redis_opts(opts, redis_params) + process_redis_opts(opts, redis_params) + end end end |