From 38e635a28a0c983938d982ffacfd0863dd832933 Mon Sep 17 00:00:00 2001 From: Philoul Date: Sun, 7 Aug 2022 18:54:13 +0200 Subject: [PATCH] Fix NPE AutotuneIob --- .../androidaps/plugins/general/autotune/AutotuneIob.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneIob.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneIob.kt index a634ee876c..6b29491848 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneIob.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneIob.kt @@ -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)