From 2b0bdda1e04c8685f92b9cc3449cd2a5a03ffd8b Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 29 Sep 2020 09:23:13 +0200 Subject: [PATCH] Fix type hinting --- sources/Renderer/RenderingOutput.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sources/Renderer/RenderingOutput.php b/sources/Renderer/RenderingOutput.php index bd53ca5e5..2e3cd73d6 100644 --- a/sources/Renderer/RenderingOutput.php +++ b/sources/Renderer/RenderingOutput.php @@ -116,10 +116,12 @@ class RenderingOutput * * @return \Combodo\iTop\Renderer\RenderingOutput */ - public function AddHtml(string $sHtml, bool $bEncodeHtmlEntities = false) + public function AddHtml(?string $sHtml, bool $bEncodeHtmlEntities = false) { - $this->sHtml .= ($bEncodeHtmlEntities) ? htmlentities($sHtml, ENT_QUOTES, 'UTF-8') : $sHtml; - + if (!is_null($sHtml)) { + $this->sHtml .= ($bEncodeHtmlEntities) ? htmlentities($sHtml, ENT_QUOTES, 'UTF-8') : $sHtml; + } + return $this; }