]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to work with non-registered symbols
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 25 Feb 2020 15:31:55 +0000 (15:31 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 25 Feb 2020 15:31:55 +0000 (15:31 +0000)
src/lua/lua_task.c

index d5a1cd59e393ee01f5f3f0cacaeb17122c011646..82556279bebe760752962e8008f1760dd40fee78 100644 (file)
@@ -4774,9 +4774,10 @@ lua_task_process_ann_tokens (lua_State *L)
                        sres = rspamd_task_find_symbol_result (task, sym);
 
                        if (sres && !(sres->flags & RSPAMD_SYMBOL_RESULT_IGNORED)) {
+
                                if (!isnan (sres->score) && !isinf (sres->score) &&
-                                       !(rspamd_symcache_item_flags (sres->sym->cache_item) &
-                                         SYMBOL_TYPE_NOSTAT)) {
+                                               (!sres->sym ||
+                                                       !(rspamd_symcache_item_flags (sres->sym->cache_item) & SYMBOL_TYPE_NOSTAT))) {
 
                                        lua_pushnumber (L, fabs (tanh (sres->score)));
                                        lua_rawseti (L, 3, offset + 1);