]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to work without rspamd_config object
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 6 Apr 2019 08:36:00 +0000 (09:36 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 6 Apr 2019 08:36:00 +0000 (09:36 +0100)
lualib/lua_redis.lua

index a93545f230980cbc370ca4d920c47d3ec8273c53..941ac383a6bdd0c975dd6483ab6095337e19fffc 100644 (file)
@@ -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