summaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-07-11 16:23:33 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-07-11 16:23:33 +0100
commitea14905c994fa7e0df53f8f6989e8c65c37606d5 (patch)
tree2a3391253efc9f8cc03e64c2e7a2b93731ecd02c /src/lua
parent3cb946c77d0c06750ccb3a4cbb709244dfd69344 (diff)
downloadrspamd-ea14905c994fa7e0df53f8f6989e8c65c37606d5.tar.gz
rspamd-ea14905c994fa7e0df53f8f6989e8c65c37606d5.zip
[Fix] Do not crash if symbol is missing in the metric
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_task.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 61aac63f2..21e24fc45 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -4716,7 +4716,7 @@ lua_push_symbol_result(lua_State *L,
lua_settable(L, -3);
/* Dynamic weight of the symbol */
- if (s->sym->score != 0) {
+ if (s->sym != NULL && s->sym->score != 0) {
lua_pushstring(L, "weight");
lua_pushnumber(L, s->score / s->sym->score);
}