From 6fe589b312379fc70cc7ce1ac5539dc624ce367c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 9 Jan 2020 14:48:36 +0000 Subject: [PATCH] [Minor] Check contents object type --- lualib/lua_content/pdf.lua | 5 +++-- 1 file 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 = {} -- 2.39.5