Browse Source

Fix for: Improved compatibility with texts that contain the carriage return character '\r'.

Marcin Ziąbek 1 year ago
parent
commit
6012b71521
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/QuestPDF/Elements/Text/TextBlock.cs

+ 1 - 1
Source/QuestPDF/Elements/Text/TextBlock.cs

@@ -233,7 +233,7 @@ namespace QuestPDF.Elements.Text
 
         private void RemoveCarriageReturnCharacters()
         {
-            foreach (var textBlockSpan in Items.OfType<TextBlockSpan>())
+            foreach (var textBlockSpan in Items.OfType<TextBlockSpan>().Where(x => x.Text != null))
                 textBlockSpan.Text = textBlockSpan.Text.Replace("\r", "");
         }