diff --git a/extensions/mentions/src/Formatter/UnparsePostMentions.php b/extensions/mentions/src/Formatter/UnparsePostMentions.php index 78a692bfd5..e7866deab4 100644 --- a/extensions/mentions/src/Formatter/UnparsePostMentions.php +++ b/extensions/mentions/src/Formatter/UnparsePostMentions.php @@ -34,6 +34,10 @@ public function __construct(TranslatorInterface $translator) */ public function __invoke($context, $xml) { + if ($xml === null) { + return $xml; + } + $xml = $this->updatePostMentionTags($context, $xml); $xml = $this->unparsePostMentionTags($xml); diff --git a/extensions/mentions/src/Formatter/UnparseTagMentions.php b/extensions/mentions/src/Formatter/UnparseTagMentions.php index a0075cb310..c4d98debaf 100644 --- a/extensions/mentions/src/Formatter/UnparseTagMentions.php +++ b/extensions/mentions/src/Formatter/UnparseTagMentions.php @@ -24,6 +24,10 @@ class UnparseTagMentions */ public function __invoke($context, $xml) { + if ($xml === null) { + return $xml; + } + $xml = $this->updateTagMentionTags($context, $xml); $xml = $this->unparseTagMentionTags($xml); diff --git a/extensions/mentions/src/Formatter/UnparseUserMentions.php b/extensions/mentions/src/Formatter/UnparseUserMentions.php index 6ca5bb3dfd..cdba49b76a 100644 --- a/extensions/mentions/src/Formatter/UnparseUserMentions.php +++ b/extensions/mentions/src/Formatter/UnparseUserMentions.php @@ -35,6 +35,10 @@ public function __construct(TranslatorInterface $translator) */ public function __invoke($context, $xml) { + if ($xml === null) { + return $xml; + } + $xml = $this->updateUserMentionTags($context, $xml); $xml = $this->unparseUserMentionTags($xml);