diff --git a/lib/utils/mergeQueryFromAbility.ts b/lib/utils/mergeQueryFromAbility.ts index 807e200..e6ad66d 100644 --- a/lib/utils/mergeQueryFromAbility.ts +++ b/lib/utils/mergeQueryFromAbility.ts @@ -69,7 +69,7 @@ export default function mergeQueryFromAbility( $and.forEach(q => { query = mergeQuery(query, q, { defaultHandle: "intersect", - operators: service.options.whitelist, + operators: service.options?.whitelist, useLogicalConjunction: true }); }); @@ -80,7 +80,7 @@ export default function mergeQueryFromAbility( if (!originalQuery) { return query; } else { - const operators = service.options.whitelist; + const operators = service.options?.whitelist; return mergeQuery( originalQuery, query, {