Skip to content

chore: prevent null loading sync settings #17430

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 16, 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: when saving sync settings, prevent nil
Nulls passed to the frontend cause errors
  • Loading branch information
Emyrk committed Apr 16, 2025
commit 8b4fc3c992f3afd71641fdef8fa35cdcae7e934e
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 @@ -217,6 +217,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