From 91016c6dc98d3487179d491bee3774e3c75b5c9d 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 }