Fix lucene filtering crashing when being provided an invalid binding string as the document array

This commit is contained in:
Andrew Kingston 2021-12-07 13:58:59 +00:00
parent 689f3c9647
commit 91016c6dc9
1 changed files with 3 additions and 0 deletions

View File

@ -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
}