mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-9012] Add missing null check for truncate pipe (#10461)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user