[sensors] allow sensor readings when there are warnings

This commit is contained in:
anxdpanic
2025-04-13 20:32:36 -04:00
committed by Svilen Markov
parent 8e71afe158
commit 2c3e14d84c
2 changed files with 5 additions and 4 deletions

View File

@@ -205,7 +205,7 @@ func Collect(req *SystemInfoRequest) (*SystemInfo, []error) {
// also disabled on openbsd because it's not implemented by go-psutil
if runtime.GOOS != "windows" && runtime.GOOS != "openbsd" {
sensorReadings, err := sensors.SensorsTemperatures()
if err == nil {
if sensorReadings != nil && len(sensorReadings) > 0 {
if req.CPUTempSensor != "" {
for i := range sensorReadings {
if sensorReadings[i].SensorKey == req.CPUTempSensor {