From 3c918d26c6692e3f8abd524adf751fdf0d36ff62 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 6 Apr 2019 09:36:00 +0100 Subject: [PATCH] [Minor] Allow to work without rspamd_config object --- lualib/lua_redis.lua | 16 +++++++++------- 1 file 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 -- 2.39.5