commit 5d7ba7b: [Minor] Settings: Another fix of settings application

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Jun 25 11:28:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-06-25 12:22:09 +0100
URL: https://github.com/rspamd/rspamd/commit/5d7ba7b3a66292cef8c0fe2d1daed8552fd98eb8

[Minor] Settings: Another fix of settings application

---
 src/plugins/lua/settings.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua
index e3e4b8986..de9ac5c65 100644
--- a/src/plugins/lua/settings.lua
+++ b/src/plugins/lua/settings.lua
@@ -454,14 +454,14 @@ local function check_settings(task)
               -- Extract static settings
               local cached = lua_settings.settings_by_id(s.rule.id)
 
-              if not cached then
+              if not cached or not cached.settings or not cached.settings.apply then
                 rspamd_logger.errx(task, 'unregistered settings id found: %s!', s.rule.id)
               else
                 rspamd_logger.infox(task, "<%s> apply static settings %s (id = %s); %s matched",
                     task:get_message_id(),
                     cached.name, s.rule.id,
                     table.concat(matched, ','))
-                apply_settings(task, cached.settings, s.rule.id)
+                apply_settings(task, cached.settings.apply, s.rule.id)
               end
 
             else


More information about the Commits mailing list