commit 08bf110: [Minor] Fix empty table check

Vsevolod Stakhov vsevolod at highsecure.ru
Sat Feb 27 23:07:06 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-02-27 23:05:35 +0000
URL: https://github.com/rspamd/rspamd/commit/08bf11078d67665968283b1b83bd2cf8de51f7b7 (HEAD -> master)

[Minor] Fix empty table check

---
 lualib/lua_mime.lua | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lualib/lua_mime.lua b/lualib/lua_mime.lua
index 5b1c857e9..d94335f5b 100644
--- a/lualib/lua_mime.lua
+++ b/lualib/lua_mime.lua
@@ -535,6 +535,9 @@ exports.modify_headers = function(task, hdr_alterations)
     if not hdr_flattened[hname] then
       hdr_flattened[hname] = {remove = {}}
     end
+    if not hdr_flattened[hname].remove then
+      hdr_flattened[hname].remove = {}
+    end
     local remove_tbl = hdr_flattened[hname].remove
     if type(hdr) == 'number' then
       table.insert(remove_tbl, hdr)


More information about the Commits mailing list