From ee5b2cf643e937e8f064f1e9238b3345f27f9231 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Thu, 5 Dec 2024 13:41:48 +0100 Subject: [PATCH] [ACS-9012] Add missing null check for truncate pipe --- 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; } }