Prevent crash on startup
This commit is contained in:
parent
f3be91aa18
commit
029a7e27fb
|
@ -52,7 +52,7 @@ class StatusLightHandler @Inject constructor(
|
|||
}
|
||||
|
||||
if (!config.NSCLIENT) {
|
||||
if (pump.model() == PumpType.Insulet_Omnipod) {
|
||||
if (pump.model() == PumpType.Insulet_Omnipod && pump is OmnipodPumpPlugin) { // instanceof check is needed because at startup, pump can still be VirtualPumpPlugin and that will cause a crash because of the class cast below
|
||||
handleOmnipodBatteryLevel(careportal_batterylevel, R.string.key_statuslights_bat_critical, 26.0, R.string.key_statuslights_bat_warning, 51.0, pump.batteryLevel.toDouble(), "%", (pump as OmnipodPumpPlugin).isUseRileyLinkBatteryLevel)
|
||||
} else if (pump.model() != PumpType.AccuChekCombo) {
|
||||
handleLevel(careportal_batterylevel, R.string.key_statuslights_bat_critical, 26.0, R.string.key_statuslights_bat_warning, 51.0, pump.batteryLevel.toDouble(), "%")
|
||||
|
|
Loading…
Reference in a new issue