]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix for settings without `apply`
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Aug 2019 16:12:41 +0000 (17:12 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Aug 2019 16:12:41 +0000 (17:12 +0100)
lualib/lua_settings.lua
src/plugins/lua/settings.lua

index cd8afe3ed89f57369bcdd37dc410f88fcf15779d..31c74bc988a64b12b953abdf98270faf9e269659 100644 (file)
@@ -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
index b1d7b5b0cd035462f7a1d994b143ce7068383b31..94f7a609169c123cd1811e0c55a7a4700f728dc7 100644 (file)
@@ -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