fix: prevent a crash when the sensors read is running, but the sensors list was changed (by enabling/disabling the unknown sensors) (quick fix) (#1171)

This commit is contained in:
Serhiy Mytrovtsiy
2022-11-15 16:12:33 +01:00
parent fa15d267f8
commit d5f01865c8

View File

@@ -129,7 +129,9 @@ internal class SensorsReader: Reader<[Sensor_p]> {
}
public override func read() {
let sensorsCounter = self.list.count
for (i, s) in self.list.enumerated() {
guard self.list.count == sensorsCounter else { return }
if s.group == .hid || s.isComputed {
continue
}