Fixed NullReferenceException when the text is null

This commit is contained in:
MarcinZiabek
2022-03-15 11:55:59 +01:00
parent 208235ad1e
commit a67fa754af
3 changed files with 42 additions and 6 deletions
+32
View File
@@ -339,5 +339,37 @@ namespace QuestPDF.Examples
});
});
}
[Test]
public void DrawingNullTextShouldNotThrowException()
{
RenderingTest
.Create()
.ProduceImages()
.ShowResults()
.RenderDocument(container =>
{
container.Page(page =>
{
page.Margin(50);
page.PageColor(Colors.White);
page.Size(PageSizes.A4);
page.Content().Column(column =>
{
column.Item().Text(null);
column.Item().Text(text =>
{
text.Span(null);
text.Line(null);
text.Hyperlink(null, "http://www.questpdf.com");
text.TotalPages().Format(x => null);
});
});
});
});
}
}
}