Fix crash on /minio/metrics/v3?list (#19745)

An unchecked map access was causing panic.
This commit is contained in:
Shireesh Anjal 2024-05-15 21:36:35 +05:30 committed by GitHub
parent 6d3e0c7db6
commit c05ca63158
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -105,8 +105,8 @@ func (h *metricsV3Server) listMetrics(path string) http.Handler {
if collPath.isDescendantOf(path) {
if v, ok := h.metricsData.mgMap[collPath]; ok {
matchingMG[collPath] = v
} else {
matchingMG[collPath] = h.metricsData.bucketMGMap[collPath]
} else if v, ok := h.metricsData.bucketMGMap[collPath]; ok {
matchingMG[collPath] = v
}
}
}