Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
Add nil user check to MayUse
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Aug 7, 2023
1 parent 0f28db1 commit 0c0ff5b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions access/account/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ func (u *User) MayUsePrioritySupport() bool {
// Leave feature ID empty to check without feature.
func (u *User) MayUse(featureID FeatureID) bool {
switch {
case u == nil:
// We need a user, obviously.
case u.State != UserStateApproved:
// Only approved users may use the SPN.
case u.Subscription == nil:
Expand Down

0 comments on commit 0c0ff5b

Please sign in to comment.