From bace3b9dcca34d195e0bcb4cb73e0c8246296edf Mon Sep 17 00:00:00 2001 From: MichalKinas <113341662+MichalKinas@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:02:27 +0100 Subject: [PATCH] [ACS-9012] Add missing null check for truncate pipe (#10461) --- lib/core/src/lib/pipes/truncate.pipe.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/src/lib/pipes/truncate.pipe.ts b/lib/core/src/lib/pipes/truncate.pipe.ts index 309370e3c1..e27ee70aec 100644 --- a/lib/core/src/lib/pipes/truncate.pipe.ts +++ b/lib/core/src/lib/pipes/truncate.pipe.ts @@ -23,6 +23,6 @@ import { Pipe, PipeTransform } from '@angular/core'; }) export class TruncatePipe implements PipeTransform { transform(value: string, maxTextLength = 250, ellipsis = '...') { - return value.length > maxTextLength ? value.slice(0, maxTextLength) + ellipsis : value; + return value?.length > maxTextLength ? value.slice(0, maxTextLength) + ellipsis : value; } }