fix crash
This commit is contained in:
parent
64634e3f95
commit
ea60e21d1a
1 changed files with 10 additions and 4 deletions
|
@ -1196,15 +1196,21 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
||||||
val lowReservoirAlertEnabled = sp.getBoolean(R.string.key_omnipod_common_low_reservoir_alert_enabled, true)
|
val lowReservoirAlertEnabled = sp.getBoolean(R.string.key_omnipod_common_low_reservoir_alert_enabled, true)
|
||||||
val lowReservoirAlertUnits = sp.getInt(R.string.key_omnipod_common_low_reservoir_alert_units, 10)
|
val lowReservoirAlertUnits = sp.getInt(R.string.key_omnipod_common_low_reservoir_alert_units, 10)
|
||||||
|
|
||||||
if (podStateManager.sameAlertSettings(
|
when {
|
||||||
|
podStateManager.sameAlertSettings(
|
||||||
expirationReminderEnabled,
|
expirationReminderEnabled,
|
||||||
expirationHours,
|
expirationHours,
|
||||||
lowReservoirAlertEnabled,
|
lowReservoirAlertEnabled,
|
||||||
lowReservoirAlertUnits
|
lowReservoirAlertUnits
|
||||||
)
|
) -> {
|
||||||
) {
|
aapsLogger.debug(LTag.PUMP, "Ignoring updateAlertConfiguration because the settings did not change")
|
||||||
return PumpEnactResult(injector).success(true).enacted(false)
|
return PumpEnactResult(injector).success(true).enacted(false)
|
||||||
}
|
}
|
||||||
|
!podStateManager.isPodRunning -> {
|
||||||
|
aapsLogger.debug(LTag.PUMP, "Ignoring updateAlertConfiguration because there is no active pod")
|
||||||
|
return PumpEnactResult(injector).success(true).enacted(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val podLifeLeft = Duration.between(ZonedDateTime.now(), podStateManager.expiry)
|
val podLifeLeft = Duration.between(ZonedDateTime.now(), podStateManager.expiry)
|
||||||
val expiryAlertDelay = podLifeLeft.minus(Duration.ofHours(expirationHours.toLong()))
|
val expiryAlertDelay = podLifeLeft.minus(Duration.ofHours(expirationHours.toLong()))
|
||||||
|
|
Loading…
Reference in a new issue