Skip to content

Commit

Permalink
fix(index.ts): add check for permissions and args existence to preven…
Browse files Browse the repository at this point in the history
…t potential errors
  • Loading branch information
multipliedtwice committed Jul 30, 2024
1 parent 3fdcb71 commit 1cb1bdf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export function validateNestedPermissions({
model,
args,
}: CheckNestedPermissionsParams): boolean {
if (!permissions || !args) return false;
return !Object.entries(args).some(([key, value]) => {
return checkPermissionForNested({ permissions, synonyms, value, model, key });
});
Expand Down

0 comments on commit 1cb1bdf

Please sign in to comment.