From: Marcel Werk Date: Tue, 10 Dec 2024 11:22:15 +0000 (+0100) Subject: Skip truncate if value is empty or null X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e80873f2d4adffb06c7afccd4b5063baae2d18a3;p=GitHub%2FWoltLab%2FWCF.git Skip truncate if value is empty or null --- diff --git a/wcfsetup/install/files/lib/system/gridView/renderer/TruncatedTextColumnRenderer.class.php b/wcfsetup/install/files/lib/system/gridView/renderer/TruncatedTextColumnRenderer.class.php index e6299edb4b..e229d234ce 100644 --- a/wcfsetup/install/files/lib/system/gridView/renderer/TruncatedTextColumnRenderer.class.php +++ b/wcfsetup/install/files/lib/system/gridView/renderer/TruncatedTextColumnRenderer.class.php @@ -22,6 +22,10 @@ class TruncatedTextColumnRenderer extends DefaultColumnRenderer #[\Override] public function render(mixed $value, mixed $context = null): string { + if (!$value) { + return ''; + } + $renderedValue = StringUtil::encodeHTML(StringUtil::truncate($value, $this->length, $this->etc)); if (\mb_strlen($value) > $this->length) {