commit 456880e: [Minor] Fix for settings without `apply`

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Aug 15 16:14:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-08-15 17:12:41 +0100
URL: https://github.com/rspamd/rspamd/commit/456880ef0ab91d3cea8d83d1be9a670a8968ec67 (HEAD -> master)

[Minor] Fix for settings without `apply`

---
 lualib/lua_settings.lua      | 2 +-
 src/plugins/lua/settings.lua | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lualib/lua_settings.lua b/lualib/lua_settings.lua
index cd8afe3ed..31c74bc98 100644
--- a/lualib/lua_settings.lua
+++ b/lualib/lua_settings.lua
@@ -46,7 +46,7 @@ local function register_settings_cb()
     local symnames = lua_util.list_to_hash(lua_util.keys(all_symbols))
 
     for _,set in pairs(known_ids) do
-      local s = set.settings.apply
+      local s = set.settings.apply or {}
       set.symbols = lua_util.shallowcopy(symnames)
       local enabled_symbols = {}
       local seen_enabled = false
diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua
index b1d7b5b0c..94f7a6091 100644
--- a/src/plugins/lua/settings.lua
+++ b/src/plugins/lua/settings.lua
@@ -918,7 +918,7 @@ local function process_settings_table(tbl, allow_ids, mempool)
             name, elt.id, out.id)
       end
 
-      if elt.apply.symbols then
+      if elt.apply and elt.apply.symbols then
         -- Register virtual symbols
         for k,v in pairs(elt.apply.symbols) do
           if type(k) == 'number' and type(v) == 'string' then


More information about the Commits mailing list