From aa7c1d0fe87c27f49fcb15ce2895301307773707 Mon Sep 17 00:00:00 2001 From: Yannik Firre <3316758+YannikFirre@users.noreply.github.com> Date: Tue, 22 Sep 2020 16:28:52 +0200 Subject: [PATCH] FIX - When setComplexValue is not found --- src/PhpWord/TemplateProcessor.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php index 7efc0f1a..7f50e3fb 100644 --- a/src/PhpWord/TemplateProcessor.php +++ b/src/PhpWord/TemplateProcessor.php @@ -274,6 +274,11 @@ class TemplateProcessor $elementWriter->write(); $where = $this->findContainingXmlBlockForMacro($search, 'w:r'); + + if($where === false) { + return ; + } + $block = $this->getSlice($where['start'], $where['end']); $textParts = $this->splitTextIntoTexts($block); $this->replaceXmlBlock($search, $textParts, 'w:r');