From 00179c8a33e1b29a10b8dac6c9c37264ad74d571 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 7 Dec 2021 13:58:59 +0000 Subject: [PATCH] Fix lucene filtering crashing when being provided an invalid binding string as the document array --- packages/builder/src/helpers/lucene.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/builder/src/helpers/lucene.js b/packages/builder/src/helpers/lucene.js index 5b8e1b805e..2348bb1114 100644 --- a/packages/builder/src/helpers/lucene.js +++ b/packages/builder/src/helpers/lucene.js @@ -97,6 +97,9 @@ export const buildLuceneQuery = filter => { * @param query the JSON lucene query */ export const luceneQuery = (docs, query) => { + if (!docs || !Array.isArray(docs)) { + return [] + } if (!query) { return docs }