Merge pull request #430 from zlangner/patch-1

Fixed null ref exception in PdfDocumentBuilder
This commit is contained in:
Eliot Jones
2022-03-14 12:20:12 -04:00
committed by GitHub

View File

@@ -400,7 +400,13 @@ namespace UglyToad.PdfPig.Writer
var val = kvp.Value;
if (kvp.Value is IndirectReferenceToken ir)
{
val = document.Structure.TokenScanner.Get(ir.Data).Data;
ObjectToken tk = document.Structure.TokenScanner.Get(ir.Data);
if (tk == null)
{
// malformed
continue;
}
val = tk.Data;
}
if (!(val is ArrayToken arr))