fix: add checks for nil HTTP in admin-trace matches func (#5216)

This commit is contained in:
Burkov Egor
2025-06-23 08:14:30 -07:00
committed by GitHub
parent 68f1d43f05
commit 00fb114bce
+4 -6
View File
@@ -411,12 +411,10 @@ func (opts matchOpts) matches(traceInfo madmin.ServiceTraceInfo) bool {
}
}
if opts.requestSize > 0 && traceInfo.Trace.HTTP.CallStats.InputBytes < int(opts.requestSize) {
return false
}
if opts.responseSize > 0 && traceInfo.Trace.HTTP.CallStats.OutputBytes < int(opts.responseSize) {
return false
if traceInfo.Trace.HTTP != nil {
if (opts.requestSize > 0 && traceInfo.Trace.HTTP.CallStats.InputBytes < int(opts.requestSize)) || (opts.responseSize > 0 && traceInfo.Trace.HTTP.CallStats.OutputBytes < int(opts.responseSize)) {
return false
}
}
return true