mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
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
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user