Fix potential null-pointer

This commit is contained in:
Ilja Neumann
2020-07-31 23:13:50 +02:00
committed by Jörn Friedrich Dreyer
parent 1deada443e
commit 9999088813
+1 -1
View File
@@ -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 {