diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php
index 6f2d7c7905..c3c43822ab 100644
--- a/src/Content/Text/HTML.php
+++ b/src/Content/Text/HTML.php
@@ -188,6 +188,10 @@ class HTML
$message = str_replace(["\n<", ">\n", "\r", "\n", "\xC3\x82\xC2\xA0"], ["<", ">", "
", " ", ""], $message);
$message = preg_replace('= [\s]*=i', " ", $message);
+ if (empty($message)) {
+ return '';
+ }
+
@$doc->loadHTML($message, LIBXML_HTML_NODEFDTD);
self::tagToBBCode($doc, 'html', [], "", "");