Skip to content

Commit

Permalink
Avoid panic if Config.Workspace.CurrentUser.User is not set (#1993)
Browse files Browse the repository at this point in the history
## Changes
Extra check to avoid panic if /api/2.0/preview/scim/v2/Me returns `{}`

## Tests
Existing tests.
  • Loading branch information
denik authored Dec 11, 2024
1 parent ad1359c commit 67f08ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bundle/config/mutator/expand_workspace_root.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (m *expandWorkspaceRoot) Apply(ctx context.Context, b *bundle.Bundle) diag.
}

currentUser := b.Config.Workspace.CurrentUser
if currentUser == nil || currentUser.UserName == "" {
if currentUser == nil || currentUser.User == nil || currentUser.UserName == "" {
return diag.Errorf("unable to expand workspace root: current user not set")
}

Expand Down

0 comments on commit 67f08ba

Please sign in to comment.