Skip to content

Commit 8922632

Browse files
authored
Merge pull request #1936 from YannikFirre/patch-1
Add null check when setComplexValue is not found
2 parents 3c66ce9 + 24e4654 commit 8922632

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/PhpWord/TemplateProcessor.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ public function setComplexValue($search, \PhpOffice\PhpWord\Element\AbstractElem
278278
$elementWriter->write();
279279

280280
$where = $this->findContainingXmlBlockForMacro($search, 'w:r');
281+
282+
if ($where === false) {
283+
return;
284+
}
285+
281286
$block = $this->getSlice($where['start'], $where['end']);
282287
$textParts = $this->splitTextIntoTexts($block);
283288
$this->replaceXmlBlock($search, $textParts, 'w:r');

0 commit comments

Comments
 (0)