Skip to content

Commit

Permalink
Merge pull request #14606 from Budibase/fix-empty-conditions
Browse files Browse the repository at this point in the history
Fix conditions with empty values falsely evaluating to true
  • Loading branch information
aptkingston authored Sep 19, 2024
2 parents 5d945b9 + bfc9e20 commit 706bc9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/client/src/utils/conditions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { QueryUtils } from "@budibase/frontend-core"
import { EmptyFilterOption } from "@budibase/types"

export const getActiveConditions = conditions => {
if (!conditions?.length) {
Expand Down Expand Up @@ -33,7 +34,8 @@ export const getActiveConditions = conditions => {
value: condition.referenceValue,
}

const query = QueryUtils.buildQuery([luceneCondition])
let query = QueryUtils.buildQuery([luceneCondition])
query.onEmptyFilter = EmptyFilterOption.RETURN_NONE
const result = QueryUtils.runQuery([luceneCondition], query)
return result.length > 0
})
Expand Down

0 comments on commit 706bc9f

Please sign in to comment.