Fix NPE AutotuneIob

This commit is contained in:
Philoul 2022-08-07 18:54:13 +02:00
parent 1731228c81
commit 38e635a28a

View file

@ -381,9 +381,11 @@ open class AutotuneIob @Inject constructor(
}
}
TherapyEvent.Type.COMBO_BOLUS ->
extendedBolus?.let {
val profile = profileFunction.getProfile(it.timestamp)
it.toJson(true, profile!!, dateUtil)
extendedBolus?.let { ebr ->
val profile = profileFunction.getProfile(ebr.timestamp)
profile?.let {
ebr.toJson(true, it, dateUtil)
}
}
TherapyEvent.Type.CORRECTION_BOLUS -> bolusTreatment?.toJson(true, dateUtil)
TherapyEvent.Type.CARBS_CORRECTION -> carbsTreatment?.toJson(true, dateUtil)