From 0c0ff5be6de5a00bd847452d658e359bbf037fa3 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 7 Aug 2023 20:53:25 +0200 Subject: [PATCH] Add nil user check to MayUse --- access/account/types.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/access/account/types.go b/access/account/types.go index a866e88..11b2dfb 100644 --- a/access/account/types.go +++ b/access/account/types.go @@ -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: