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

Skip to content

Commit 8b4fc3c

Browse files
committed
chore: when saving sync settings, prevent nil
Nulls passed to the frontend cause errors
1 parent a8c2586 commit 8b4fc3c

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
@@ -217,6 +217,9 @@ func (s *OrganizationSyncSettings) Set(v string) error {
217217
}
218218

219219
func (s *OrganizationSyncSettings) String() string {
220+
if s.Mapping == nil {
221+
s.Mapping = make(map[string][]uuid.UUID)
222+
}
220223
return runtimeconfig.JSONString(s)
221224
}
222225

coderd/idpsync/role.go

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

288288
func (s *RoleSyncSettings) String() string {
289+
if s.Mapping == nil {
290+
s.Mapping = make(map[string][]string)
291+
}
289292
return runtimeconfig.JSONString(s)
290293
}

0 commit comments

Comments
 (0)