Skip to content

Commit

Permalink
[ACS-9012] Add missing null check for truncate pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalKinas committed Dec 5, 2024
1 parent 60a9565 commit ee5b2cf
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 ee5b2cf

Please sign in to comment.