From 840d32622fbfc6b3a796a4b7d3e7b48f54da8c37 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 17 Dec 2021 21:32:17 +0100 Subject: [PATCH] check for nil isolatedCpus before calling updateIsolated Signed-off-by: david --- collector/cpu_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/cpu_linux.go b/collector/cpu_linux.go index f680871d..afc3a23c 100644 --- a/collector/cpu_linux.go +++ b/collector/cpu_linux.go @@ -167,8 +167,8 @@ func (c *cpuCollector) Update(ch chan<- prometheus.Metric) error { if err := c.updateStat(ch); err != nil { return err } - if err := c.updateIsolated(ch); err != nil { - return err + if c.isolatedCpus != nil { + c.updateIsolated(ch) } return c.updateThermalThrottle(ch) }