Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit de5972d

Browse files
authored
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
1 parent 7d0e909 commit de5972d

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

coderd/idpsync/group.go

+3
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ func (s *GroupSyncSettings) Set(v string) error {
268268
}
269269

270270
func (s *GroupSyncSettings) String() string {
271+
if s.Mapping == nil {
272+
s.Mapping = make(map[string][]uuid.UUID)
273+
}
271274
return runtimeconfig.JSONString(s)
272275
}
273276

coderd/idpsync/organization.go

+3
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ func (s *OrganizationSyncSettings) Set(v string) error {
168168
}
169169

170170
func (s *OrganizationSyncSettings) String() string {
171+
if s.Mapping == nil {
172+
s.Mapping = make(map[string][]uuid.UUID)
173+
}
171174
return runtimeconfig.JSONString(s)
172175
}
173176

coderd/idpsync/role.go

+3
Original file line numberDiff line numberDiff line change
@@ -284,5 +284,8 @@ func (s *RoleSyncSettings) Set(v string) error {
284284
}
285285

286286
func (s *RoleSyncSettings) String() string {
287+
if s.Mapping == nil {
288+
s.Mapping = make(map[string][]string)
289+
}
287290
return runtimeconfig.JSONString(s)
288291
}

0 commit comments

Comments
 (0)