diff --git a/src/BaseElement.php b/src/BaseElement.php index d1d4235..165a51a 100644 --- a/src/BaseElement.php +++ b/src/BaseElement.php @@ -297,7 +297,7 @@ public function prependChild($children, $mapper = null) */ public function text($text) { - return $this->html(htmlentities($text, ENT_QUOTES, 'UTF-8', false)); + return $this->html(htmlentities($text ?? '', ENT_QUOTES, 'UTF-8', false)); } /**