aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-01-09 14:48:36 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-01-09 14:48:36 +0000
commit6fe589b312379fc70cc7ce1ac5539dc624ce367c (patch)
treec05d7b8f07dce78e91f1b20ccc684d7ec515270b
parent25fbf9a11b80c3a7ac2ecffbbd6c35760393c7df (diff)
downloadrspamd-6fe589b312379fc70cc7ce1ac5539dc624ce367c.tar.gz
rspamd-6fe589b312379fc70cc7ce1ac5539dc624ce367c.zip
[Minor] Check contents object type
-rw-r--r--lualib/lua_content/pdf.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/lualib/lua_content/pdf.lua b/lualib/lua_content/pdf.lua
index f29e1e781..741c011bd 100644
--- a/lualib/lua_content/pdf.lua
+++ b/lualib/lua_content/pdf.lua
@@ -386,8 +386,9 @@ local function process_dict(task, pdf, obj, dict)
lua_util.debugm(N, task, 'process stream dictionary for object %s:%s -> %s',
obj.major, obj.minor, obj.type)
local contents = dict.Contents
- if contents then
- if type(contents) == 'table' and contents[1] == '%REF%' then
+ if contents and type(contents) == 'table' then
+ if contents[1] == '%REF%' then
+ -- Single reference
contents = {contents}
end
obj.contents = {}