diff --git a/src/Logic/State/SearchState.ts b/src/Logic/State/SearchState.ts index 44eaccc3fb..31b75a7b33 100644 --- a/src/Logic/State/SearchState.ts +++ b/src/Logic/State/SearchState.ts @@ -73,7 +73,7 @@ export default class SearchState { .mapD(list => list.map(sugg => sugg.results)) const isRunningPerEngine: Store[]> = - suggestionsListWithSource.map( + suggestionsListWithSource.mapD( allProviders => allProviders.map(provider => provider.results.map(result => { if (result === undefined) { @@ -102,7 +102,7 @@ export default class SearchState { return [] } }), - ))).map(list => Utils.NoNull(list.flatMap(x => x))) + ))).map(list => Utils.NoNull(list?.flatMap(x => x) ?? [])) this.suggestionsSearchRunning = this.runningEngines.map(running => running?.length > 0) this.suggestions = suggestionsList.bindD((suggestions) =>