handleTimeChange: fail if there is no active profile

This commit is contained in:
Andrei Vereha 2021-11-14 11:14:10 +01:00
parent f68134801a
commit eb69443709

View file

@ -1193,7 +1193,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
private fun handleTimeChange(): PumpEnactResult { private fun handleTimeChange(): PumpEnactResult {
return profileFunction.getProfile()?.let { return profileFunction.getProfile()?.let {
setNewBasalProfile(it, OmnipodCommandType.SET_TIME) setNewBasalProfile(it, OmnipodCommandType.SET_TIME)
} ?: PumpEnactResult(injector).success(true).enacted(false).comment("No profile active") } ?: PumpEnactResult(injector).success(false).enacted(false).comment("No profile active")
} }
private fun updateAlertConfiguration(): PumpEnactResult { private fun updateAlertConfiguration(): PumpEnactResult {