From: Vsevolod Stakhov Date: Thu, 15 Aug 2019 16:12:41 +0000 (+0100) Subject: [Minor] Fix for settings without `apply` X-Git-Tag: 2.0~412 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=456880ef0ab91d3cea8d83d1be9a670a8968ec67;p=rspamd.git [Minor] Fix for settings without `apply` --- 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