diff --git a/PdfSharpCore/Pdf.IO/Parser.cs b/PdfSharpCore/Pdf.IO/Parser.cs index d12a008..136d04b 100644 --- a/PdfSharpCore/Pdf.IO/Parser.cs +++ b/PdfSharpCore/Pdf.IO/Parser.cs @@ -260,6 +260,11 @@ public PdfObject ReadObject(PdfObject pdfObject, PdfObjectID objectID, bool incl ParserDiagnostics.HandleUnexpectedToken(_lexer.Token); break; + case Symbol.EndObj: + pdfObject = new PdfNullObject(_document); + pdfObject.SetObjectID(objectNumber, generationNumber); + return pdfObject; + default: // Should not come here anymore. ParserDiagnostics.HandleUnexpectedToken(_lexer.Token);