mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-01 16:16:35 +00:00
tcp: fix panic on collector (#1699)
This commit is contained in:
@@ -44,7 +44,7 @@ func (c *Collector) Collect() (map[string]map[string]perftypes.CounterValues, er
|
||||
return nil, fmt.Errorf("QueryPerformanceData: %w", err)
|
||||
}
|
||||
|
||||
if len(perfObjects) == 0 {
|
||||
if len(perfObjects) == 0 || perfObjects[0] == nil || len(perfObjects[0].Instances) == 0 {
|
||||
return map[string]map[string]perftypes.CounterValues{}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user