mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00: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:
@ -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