Skip to content

Commit

Permalink
Check for nil permissions terms during model validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ronenh committed Jul 13, 2024
1 parent 3d5e497 commit 0c2b59b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions model/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ func (v *validator) validateObjectPerms(on ObjectName, o *Object) error {
}

for _, term := range terms {
if term == nil {
errs = multierror.Append(errs, derr.ErrInvalidPermission.Msgf(
"permission '%s:%s' has an empty term", on, pn),
)
continue
}
switch {
case term.IsArrow():
// this is an arrow operator.
Expand Down

0 comments on commit 0c2b59b

Please sign in to comment.