From feb0d47aece897d0d2e035f786c0201546b57bd2 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 24 Jul 2025 19:30:22 +0200 Subject: [PATCH] Fix: crash in search code --- src/Logic/State/SearchState.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Logic/State/SearchState.ts b/src/Logic/State/SearchState.ts index 44eaccc3f..31b75a7b3 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) =>