TrackersHID fix exception from null magStatus

This commit is contained in:
sctanf authored and Jabberrock committed 2025-05-04 11:09:57 -07:00
1 parent d607614700
commit caa146770b
1 file changed
+2 -2
@@ -265,8 +265,8 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
val sensorType = IMUType.getById(imu_id.toUInt())
// only able to register magnetometer status, not magnetometer type
val magStatus = MagnetometerStatus.getById(mag_id.toUByte())
if (sensorType != null) {
setUpSensor(device, trackerId, sensorType!!, TrackerStatus.OK, magStatus!!)
if (sensorType != null && magStatus != null) {
setUpSensor(device, trackerId, sensorType, TrackerStatus.OK, magStatus)
}
}