Skip to content

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

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 1 commit into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
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 21, 2025
commit de5972dd5a1522c644caf258d3dc3f7cd710db0a
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 @@ -284,5 +284,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