Still add text if link missing

If link target doesn't exist, still add the text anyway.
This commit is contained in:
Craig Blanchette 2018-12-19 15:17:42 -05:00 committed by GitHub
parent 0db21ae115
commit b1661af71a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -297,6 +297,8 @@ abstract class AbstractPart
$target = $this->getMediaTarget($docPart, $rId); $target = $this->getMediaTarget($docPart, $rId);
if (!is_null($target)) { if (!is_null($target)) {
$parent->addLink($target, $textContent, $fontStyle, $paragraphStyle); $parent->addLink($target, $textContent, $fontStyle, $paragraphStyle);
} else {
$parent->addText($textContent, $fontStyle, $paragraphStyle);
} }
} else { } else {
/** @var AbstractElement $element */ /** @var AbstractElement $element */