Object reference not set to an instance of an object in UglyToad.PdfPig.Parser.DocumentInformationFactory.Create
I have PDF file that is failing in
UglyToad.PdfPig.Parser.DocumentInformationFactory.Create method, because "token" is null.
What is the reason to throw exception in this case?
throw new PdfDocumentFormatException($"Unknown document information token was found {token?.GetType()?.Name}");
I think it could be better to just replace it with
return DocumentInformation.Default;
Which I did in my local test, and the file was opened correctly. Version 0.1.5-alpha002
In version 0.1.4 it was failling in
UglyToad.PdfPig.Parser.DocumentInformationFactory.GetEntryOrDefault
Thanks in advance
Hi @cysieks am I understanding correctly that you no longer get this null reference exception when using version 0.1.5-alpha002?
Sorry, my writing was misleading. This happens in version Version 0.1.5-alpha002.
In version 0.1.4 exception is raised in UglyToad.PdfPig.Parser.DocumentInformationFactory.GetEntryOrDefault
The problem was resolved, when I locally build the library, replacing line with exception throw new PdfDocumentFormatException($"Unknown document information token was found {token?.GetType()?.Name}"); to return DocumentInformation.Default;