diff --git a/cli/commands/helpers/user.go b/cli/commands/helpers/user.go index c22105ea96..115ecc9c0e 100644 --- a/cli/commands/helpers/user.go +++ b/cli/commands/helpers/user.go @@ -15,6 +15,9 @@ func GetCurrentUsername(cfg config.Config) string { accessToken := tokens.Access token, _ := jwt.ParseWithClaims(accessToken, &corev2.Claims{}, nil) + if token == nil { + return "" + } claims := token.Claims.(*corev2.Claims) return claims.StandardClaims.Subject }