mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
[ACS-9012] Add missing null check for truncate pipe (#10461)
This commit is contained in:
parent
2b0100466a
commit
bace3b9dcc
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user