From 974182e810b7496a73eba20bf00eaaeb3e2baf73 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Sat, 24 Dec 2022 17:47:07 +0100 Subject: [PATCH] Fixing missing list error --- src/backend/model/database/sql/SearchManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/model/database/sql/SearchManager.ts b/src/backend/model/database/sql/SearchManager.ts index 02e0d3c3..1bb81ed1 100644 --- a/src/backend/model/database/sql/SearchManager.ts +++ b/src/backend/model/database/sql/SearchManager.ts @@ -841,7 +841,7 @@ export class SearchManager implements ISQLSearchManager { case SearchQueryTypes.OR: return { type: query.type, - list: (query as SearchListQuery).list.map( + list: ((query as SearchListQuery).list || []).map( (q): SearchQueryDTO => this.flattenSameOfQueries(q) ), } as SearchListQuery; @@ -856,7 +856,7 @@ export class SearchManager implements ISQLSearchManager { } as ORSearchQuery); } - if (someOfQ.min === (query as SearchListQuery).list.length) { + if (someOfQ.min === ((query as SearchListQuery).list || []).length) { return this.flattenSameOfQueries({ type: SearchQueryTypes.AND, list: (someOfQ as SearchListQuery).list,