From ca0dc030ade5f1c941a66437e2f228bdda73d546 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 23 Oct 2024 15:08:59 +0100 Subject: [PATCH] Make sure processSearchFilters handles an undefined input. --- packages/shared-core/src/utils.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/shared-core/src/utils.ts b/packages/shared-core/src/utils.ts index 5db4ead1dc..8e22c10c15 100644 --- a/packages/shared-core/src/utils.ts +++ b/packages/shared-core/src/utils.ts @@ -138,9 +138,16 @@ export function isSupportedUserSearch(query: SearchFilters) { return true } -export const processSearchFilters = ( +export function processSearchFilters(filterArray: undefined): undefined +export function processSearchFilters( filterArray: LegacyFilter[] -): Required => { +): Required +export function processSearchFilters( + filterArray?: LegacyFilter[] +): Required | undefined { + if (!filterArray) { + return undefined + } const { allOr, onEmptyFilter, filters } = splitFiltersArray(filterArray) return { logicalOperator: UILogicalOperator.ALL,