Skip to content

Commit

Permalink
fix: allow service.options to be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
lukashass committed Dec 2, 2021
1 parent fb2ca55 commit df1caf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/utils/mergeQueryFromAbility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function mergeQueryFromAbility<T>(
$and.forEach(q => {
query = mergeQuery(query, q, {
defaultHandle: "intersect",
operators: service.options.whitelist,
operators: service.options?.whitelist,
useLogicalConjunction: true
});
});
Expand All @@ -80,7 +80,7 @@ export default function mergeQueryFromAbility<T>(
if (!originalQuery) {
return query;
} else {
const operators = service.options.whitelist;
const operators = service.options?.whitelist;
return mergeQuery(
originalQuery,
query, {
Expand Down

0 comments on commit df1caf0

Please sign in to comment.