From 83b0bef3a891e2304f9fe4cc832d3e5705b6fe31 Mon Sep 17 00:00:00 2001 From: neopheus Date: Mon, 12 Sep 2022 12:56:45 +0200 Subject: [PATCH] Fix #2290 --- src/PhpWord/TemplateProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php index 664d4688..14c95b18 100644 --- a/src/PhpWord/TemplateProcessor.php +++ b/src/PhpWord/TemplateProcessor.php @@ -257,7 +257,7 @@ class TemplateProcessor */ protected static function ensureUtf8Encoded($subject) { - if (!Text::isUTF8($subject)) { + if (!Text::isUTF8($subject) && !is_null($subject)) { $subject = utf8_encode($subject); }