Skip to content

Commit

Permalink
[ACS-9012] Add missing null check for truncate pipe (#10461)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalKinas authored Dec 5, 2024
1 parent 2b01004 commit bace3b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/src/lib/pipes/truncate.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit bace3b9

Please sign in to comment.