Skip to content

chore: prevent null loading sync settings (cherry-pick #17430) #17433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: prevent null loading sync settings (#17430)
Nulls passed to the frontend caused a page to fail to load.

`Record<string,string>` can be `nil` in golang
  • Loading branch information
Emyrk authored Apr 16, 2025
commit e3accbbff85b9d9acedc6146d7a51a325126c7b9
3 changes: 3 additions & 0 deletions coderd/idpsync/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ func (s *GroupSyncSettings) Set(v string) error {
}

func (s *GroupSyncSettings) String() string {
if s.Mapping == nil {
s.Mapping = make(map[string][]uuid.UUID)
}
return runtimeconfig.JSONString(s)
}

Expand Down
3 changes: 3 additions & 0 deletions coderd/idpsync/organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ func (s *OrganizationSyncSettings) Set(v string) error {
}

func (s *OrganizationSyncSettings) String() string {
if s.Mapping == nil {
s.Mapping = make(map[string][]uuid.UUID)
}
return runtimeconfig.JSONString(s)
}

Expand Down
3 changes: 3 additions & 0 deletions coderd/idpsync/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,5 +286,8 @@ func (s *RoleSyncSettings) Set(v string) error {
}

func (s *RoleSyncSettings) String() string {
if s.Mapping == nil {
s.Mapping = make(map[string][]string)
}
return runtimeconfig.JSONString(s)
}
Loading