From 999908881329143fb034ce55986aca6ba6a1e1a6 Mon Sep 17 00:00:00 2001 From: Ilja Neumann Date: Fri, 31 Jul 2020 22:58:26 +0200 Subject: [PATCH] Fix potential null-pointer --- pkg/middleware/account_uuid.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/middleware/account_uuid.go b/pkg/middleware/account_uuid.go index 5f711312b..6639ad722 100644 --- a/pkg/middleware/account_uuid.go +++ b/pkg/middleware/account_uuid.go @@ -118,7 +118,7 @@ func AccountUUID(opts ...Option) func(next http.Handler) http.Handler { l.Error().Err(err).Msgf("Could not lookup account, no mail or preferred_username claim set") w.WriteHeader(http.StatusInternalServerError) } - if status != 0 { + if status != 0 || account == nil { if status == http.StatusNotFound { account, status = createAccount(l, claims, opt.AccountsClient) if status != 0 {