mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: defensively handle nil maps and slices in marshaling (#18418)
Adds a custom marshaler to handle some cases where nils were being marshaled to nulls, causing the web UI to throw an error. --------- Co-authored-by: Steven Masley <stevenmasley@gmail.com>
This commit is contained in:
co-authored by
Steven Masley
parent
9cbe02e8b7
commit
44d46469e1
@@ -836,6 +836,9 @@ func (api *API) idpSyncClaimFieldValues(orgID uuid.UUID, rw http.ResponseWriter,
|
||||
httpapi.InternalServerError(rw, err)
|
||||
return
|
||||
}
|
||||
if fieldValues == nil {
|
||||
fieldValues = []string{}
|
||||
}
|
||||
|
||||
httpapi.Write(ctx, rw, http.StatusOK, fieldValues)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user