From e80873f2d4adffb06c7afccd4b5063baae2d18a3 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 10 Dec 2024 12:22:15 +0100 Subject: [PATCH] Skip truncate if value is empty or null --- .../gridView/renderer/TruncatedTextColumnRenderer.class.php | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- 2.20.1