From: Vsevolod Stakhov Date: Sat, 6 Apr 2019 08:36:00 +0000 (+0100) Subject: [Minor] Allow to work without rspamd_config object X-Git-Tag: 1.9.2~71 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3c918d26c6692e3f8abd524adf751fdf0d36ff62;p=rspamd.git [Minor] Allow to work without rspamd_config object --- 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