From 077b5ca10b4fb71a918dc443bdda6f9e633f61f1 Mon Sep 17 00:00:00 2001 From: rkuffer Date: Thu, 15 Jun 2023 15:55:36 +0200 Subject: [PATCH] fix sentences search filter --- .../web/src/app/search/filter/search-filter.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nlp/admin/web/src/app/search/filter/search-filter.component.ts b/nlp/admin/web/src/app/search/filter/search-filter.component.ts index 9094caa79a..3f978cc5cc 100644 --- a/nlp/admin/web/src/app/search/filter/search-filter.component.ts +++ b/nlp/admin/web/src/app/search/filter/search-filter.component.ts @@ -90,7 +90,7 @@ export class SearchFilterComponent implements OnInit, AfterViewInit { } filter(value: string): Group[] { - const filterValue = value.toLowerCase(); + const filterValue = value?.toLowerCase(); return this.groups .map((group) => { return { @@ -128,7 +128,7 @@ export class SearchFilterComponent implements OnInit, AfterViewInit { if (selected === this.noFilter) { this.filteredGroups$ = of(this.filter('')); } else { - this.filteredGroups$ = of(this.filter(selected.toString())); + this.filteredGroups$ = of(this.filter(selected?.toString())); } if (selected) { this.cachedValue = selected.label ?? selected.toString(); @@ -137,7 +137,7 @@ export class SearchFilterComponent implements OnInit, AfterViewInit { } onModelChange(value: string) { - const inputValue = value.toString().trim(); + const inputValue = value?.toString().trim(); this.filteredGroups$ = of(this.filter(inputValue)); if (inputValue === '' && this.noFilter) { this.filterChange.emit(this.noFilter.value);