aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-10 15:59:30 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-10 15:59:30 +0100
commitc4d3eb4af41a17cf28cb4fbb171d9b70d98259b5 (patch)
tree23e5a32a053f8a3a3e84a947ed0ea6fe38d257f0
parent40dd08f9b158bd715b4ca59af2577b23990240b0 (diff)
downloadrspamd-c4d3eb4af41a17cf28cb4fbb171d9b70d98259b5.tar.gz
rspamd-c4d3eb4af41a17cf28cb4fbb171d9b70d98259b5.zip
[Minor] Add safe-guards
-rw-r--r--src/plugins/lua/external_services.lua33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/plugins/lua/external_services.lua b/src/plugins/lua/external_services.lua
index 4e0ee29c9..d65a46a2c 100644
--- a/src/plugins/lua/external_services.lua
+++ b/src/plugins/lua/external_services.lua
@@ -227,20 +227,25 @@ if opts and type(opts) == 'table' then
score = 0.0,
group = N
})
- rspamd_config:register_symbol({
- type = 'virtual',
- name = m['symbol_encrypted'],
- parent = id,
- score = 0.0,
- group = N
- })
- rspamd_config:register_symbol({
- type = 'virtual',
- name = m['symbol_macro'],
- parent = id,
- score = 0.0,
- group = N
- })
+
+ if m.symbol_encrypted then
+ rspamd_config:register_symbol({
+ type = 'virtual',
+ name = m['symbol_encrypted'],
+ parent = id,
+ score = 0.0,
+ group = N
+ })
+ end
+ if m.symbol_macro then
+ rspamd_config:register_symbol({
+ type = 'virtual',
+ name = m['symbol_macro'],
+ parent = id,
+ score = 0.0,
+ group = N
+ })
+ end
has_valid = true
if type(m['patterns']) == 'table' then
if m['patterns'][1] then