diff --git a/pdf/core/parser.go b/pdf/core/parser.go index 777328c6..baa14921 100644 --- a/pdf/core/parser.go +++ b/pdf/core/parser.go @@ -804,8 +804,8 @@ func (this *PdfParser) parseXrefStream(xstm *PdfObjectInteger) (*PdfObjectDictio trailerDict := xs.PdfObjectDictionary - sizeObj := xs.PdfObjectDictionary.Get("Size").(*PdfObjectInteger) - if sizeObj == nil { + sizeObj, ok := xs.PdfObjectDictionary.Get("Size").(*PdfObjectInteger) + if !ok { common.Log.Debug("ERROR: Missing size from xref stm") return nil, errors.New("Missing Size from xref stm") }