mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-17 15:36:48 +00:00
fix(alertmanager): send empty array instead of nil (#7312)
This commit is contained in:
parent
de53119257
commit
f96a234faa
@ -97,6 +97,11 @@ func (api *API) ListChannels(rw http.ResponseWriter, req *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// This ensures that the UI receives an empty array instead of null
|
||||
if len(channels) == 0 {
|
||||
channels = make([]*alertmanagertypes.Channel, 0)
|
||||
}
|
||||
|
||||
render.Success(rw, http.StatusOK, channels)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user