From: Vsevolod Stakhov Date: Thu, 9 Jan 2020 14:48:36 +0000 (+0000) Subject: [Minor] Check contents object type X-Git-Tag: 2.3~133 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6fe589b312379fc70cc7ce1ac5539dc624ce367c;p=thirdparty%2Frspamd.git [Minor] Check contents object type --- diff --git a/lualib/lua_content/pdf.lua b/lualib/lua_content/pdf.lua index f29e1e781e..741c011bdf 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 = {}