From 32dd47804f096dc789bcc4f259fb66a852904845 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 24 Jul 2024 14:29:02 +0100 Subject: [PATCH] Fix issue with nulls in lucene isEmpty filter --- packages/shared-core/src/filters.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared-core/src/filters.ts b/packages/shared-core/src/filters.ts index 6db89dd2f3..65caa9c434 100644 --- a/packages/shared-core/src/filters.ts +++ b/packages/shared-core/src/filters.ts @@ -555,7 +555,7 @@ export const runQuery = (docs: Record[], query: SearchFilters) => { if (Array.isArray(docValue)) { return docValue.length === 0 } - if (typeof docValue === "object") { + if (docValue && typeof docValue === "object") { return Object.keys(docValue).length === 0 } return docValue == null