]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Add safe-guards
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 10 Oct 2019 14:59:30 +0000 (15:59 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 10 Oct 2019 14:59:30 +0000 (15:59 +0100)
src/plugins/lua/external_services.lua

index 4e0ee29c9c2dcbf5dc36cdd5823cc72ad83cd05f..d65a46a2c64bdd648905bf1a97bcaa0a23506e9b 100644 (file)
@@ -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