diff options
author | Andrew Lewis <nerf@judo.za.org> | 2016-11-28 12:32:01 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2016-11-28 12:32:01 +0200 |
commit | b9fc03d9f989768f1f825ea04a5168d8a89a86ef (patch) | |
tree | 21871b82f91df5ce344fd4d37adcd4749d0dbb37 | |
parent | 3b9b23600f97365585c32827c0b6df4b620c8653 (diff) | |
download | rspamd-b9fc03d9f989768f1f825ea04a5168d8a89a86ef.tar.gz rspamd-b9fc03d9f989768f1f825ea04a5168d8a89a86ef.zip |
[Minor] Avoid nil index
-rw-r--r-- | rules/misc.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rules/misc.lua b/rules/misc.lua index 7fbd9cf1a..f7b63d3c8 100644 --- a/rules/misc.lua +++ b/rules/misc.lua @@ -498,7 +498,8 @@ local check_from_id = rspamd_config:register_callback_symbol('CHECK_FROM', 1.0, -- Check if FROM == TO if (#to == 1 and to[1].addr:lower() == from[1].addr:lower()) then task:insert_result('TO_EQ_FROM', 1.0) - elseif (#to == 1 and to[1].domain:lower() == from[1].domain:lower()) then + elseif (#to == 1 and to[1].domain and from[1].domain and + to[1].domain:lower() == from[1].domain:lower()) then task:insert_result('TO_DOM_EQ_FROM_DOM', 1.0) end end |