diff --git a/Directory.Packages.props b/Directory.Packages.props
index 54705b709ce..0c6dce507be 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -23,7 +23,7 @@
-
+
diff --git a/src/Docfx.App/PdfBuilder.cs b/src/Docfx.App/PdfBuilder.cs
index 6fe4478d27e..1c31d1da660 100644
--- a/src/Docfx.App/PdfBuilder.cs
+++ b/src/Docfx.App/PdfBuilder.cs
@@ -291,7 +291,7 @@ await Parallel.ForEachAsync(pages, async (item, _) =>
if (outline.pdfTocPage)
{
var href = $"/_pdftoc{outlineUrl.AbsolutePath}";
- yield return (new(outlineUrl, href), new() { href = href, pdfPrintBackground = outline.pdfPrintBackground });
+ yield return (new(outlineUrl, href), new() { href = href, pdfPrintBackground = outline.pdfPrintBackground });
}
if (!string.IsNullOrEmpty(outline.href))
@@ -325,6 +325,9 @@ async Task MergePdf()
// Refresh TOC page numbers
updatePageNumbers(pageNumbers);
bytes = await printPdf(outline, url);
+
+ if (bytes == null)
+ continue;
}
using var document = PdfDocument.Open(bytes);