From 67f08ba924394157aa70519e3389d28667e2589d Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Wed, 11 Dec 2024 09:40:14 +0100 Subject: [PATCH] Avoid panic if Config.Workspace.CurrentUser.User is not set (#1993) ## Changes Extra check to avoid panic if /api/2.0/preview/scim/v2/Me returns `{}` ## Tests Existing tests. --- bundle/config/mutator/expand_workspace_root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle/config/mutator/expand_workspace_root.go b/bundle/config/mutator/expand_workspace_root.go index 3f0547de..a29d129b 100644 --- a/bundle/config/mutator/expand_workspace_root.go +++ b/bundle/config/mutator/expand_workspace_root.go @@ -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") }