Skip loading outlines on invalid outline root node (#84)

This commit is contained in:
Adrian-George Bostan 2019-06-10 22:16:03 +03:00 committed by Gunnsteinn Hall
parent c3a24925ff
commit 4290e33c36

View File

@ -283,7 +283,8 @@ func (r *PdfReader) loadOutlines() (*PdfOutlineTreeNode, error) {
outlineRoot, ok := outlineRootObj.(*core.PdfIndirectObject) outlineRoot, ok := outlineRootObj.(*core.PdfIndirectObject)
if !ok { if !ok {
if _, ok := core.GetDict(outlineRootObj); !ok { if _, ok := core.GetDict(outlineRootObj); !ok {
return nil, errors.New("outline root should be an indirect object") common.Log.Debug("Invalid outline root - skipping")
return nil, nil
} }
common.Log.Debug("Outline root is a dict. Should be an indirect object") common.Log.Debug("Outline root is a dict. Should be an indirect object")