fix: skip temperature collection if SENSORS is empty string (#196)

This commit is contained in:
Henry Dollman
2024-10-24 15:10:20 -04:00
parent a5f9e2615c
commit 4094df3a61
2 changed files with 7 additions and 3 deletions

View File

@@ -62,7 +62,9 @@ func (a *Agent) Run(pubKey []byte, addr string) {
if sensors, exists := os.LookupEnv("SENSORS"); exists {
a.sensorsWhitelist = make(map[string]struct{})
for _, sensor := range strings.Split(sensors, ",") {
a.sensorsWhitelist[sensor] = struct{}{}
if sensor != "" {
a.sensorsWhitelist[sensor] = struct{}{}
}
}
}