From 4fe0d1222c2ad42fc82b405157320abf08753701 Mon Sep 17 00:00:00 2001 From: Nicola Demers Date: Thu, 25 Apr 2024 17:01:28 -0400 Subject: [PATCH] Handle empty object parsing --- PdfSharpCore/Pdf.IO/Parser.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PdfSharpCore/Pdf.IO/Parser.cs b/PdfSharpCore/Pdf.IO/Parser.cs index d12a0085..136d04b9 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);