diff --git a/users/service.go b/users/service.go index 52cdee8..babe3d0 100644 --- a/users/service.go +++ b/users/service.go @@ -75,6 +75,10 @@ func GetSpotifyClient(ctx context.Context, app *core.App, user *models.User) (*s } func SaveUserToken(ctx context.Context, app *core.App, spotifyID string, token *oauth2.Token) (*models.User, error) { + if token == nil { + return nil, fmt.Errorf("token is nil") + } + coll := app.MongoClient.Database("listy").Collection("users") result, err := GetUser(ctx, app, spotifyID)