aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/stats.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/stats.go b/core/stats.go
index 4cbd9f2..48b516c 100644
--- a/core/stats.go
+++ b/core/stats.go
@@ -196,6 +196,9 @@ func (c *StatsConnection) GetNodeStats() (*api.NodeStats, error) {
}
}
for i, v := range perNode {
+ if len(nodeStats.Nodes) <= i {
+ break
+ }
nodeCounters := nodeStats.Nodes[i]
fn(&nodeCounters, v)
nodeStats.Nodes[i] = nodeCounters
@@ -257,6 +260,9 @@ func (c *StatsConnection) GetInterfaceStats() (*api.InterfaceStats, error) {
}
}
for i, v := range perIf {
+ if len(ifStats.Interfaces) <= i {
+ break
+ }
ifCounters := ifStats.Interfaces[i]
fn(&ifCounters, v)
ifStats.Interfaces[i] = ifCounters