diff --git a/pkg/bk-monitor-worker/internal/apm/pre_calculate/window/distributive.go b/pkg/bk-monitor-worker/internal/apm/pre_calculate/window/distributive.go index af6d73fd1..3bb631113 100644 --- a/pkg/bk-monitor-worker/internal/apm/pre_calculate/window/distributive.go +++ b/pkg/bk-monitor-worker/internal/apm/pre_calculate/window/distributive.go @@ -189,6 +189,9 @@ func (w *DistributiveWindow) getSubWindowMetrics(subId int) (int, int) { traceCount := 0 spanCount := 0 + if subWindow == nil { + return traceCount, spanCount + } subWindow.m.Range(func(key, value any) bool { traceCount++ v := value.(CollectTrace)