From b8ec4e548be9ac6e95e42f9897e7e253c8aaa382 Mon Sep 17 00:00:00 2001 From: Alex ORLUC <alex.orluc@maarch.org> Date: Fri, 9 Oct 2020 10:17:09 +0200 Subject: [PATCH] FEAT #13271 TIME 0:05 fix highlight --- src/frontend/plugins/highlight.pipe.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend/plugins/highlight.pipe.ts b/src/frontend/plugins/highlight.pipe.ts index d2b11486f20..f372db5b089 100644 --- a/src/frontend/plugins/highlight.pipe.ts +++ b/src/frontend/plugins/highlight.pipe.ts @@ -12,7 +12,8 @@ export class HighlightPipe { transform(text: string, args: string = '') { let formatedText = ''; - if (typeof text === 'string') { + + if (typeof text === 'string' && typeof args === 'string') { const index = this.latinisePipe.transform(text.toLowerCase()).indexOf(this.latinisePipe.transform(args.toLowerCase())); if (index >= 0) { formatedText = text.substring(0, index) + '<span class=\'highlightResult\'>' + text.substring(index, index + args.length) + '</span>' + text.substring(index + args.length); -- GitLab