From b588211658c497e31b9506d795db950c73bae904 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Wed, 25 Jan 2017 15:37:05 +0100 Subject: [PATCH] prevent nullpointer exception when BG <39 --- .../plugins/OpenAPSAMA/DetermineBasalResultAMA.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalResultAMA.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalResultAMA.java index ee877c8260..652ec856bd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalResultAMA.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalResultAMA.java @@ -34,8 +34,8 @@ public class DetermineBasalResultAMA extends APSResult { duration = -1; } else { reason = result.getString("reason"); - eventualBG = result.getDouble("eventualBG"); - snoozeBG = result.getDouble("snoozeBG"); + if (result.contains("eventualBG")) eventualBG = result.getDouble("eventualBG"); + if (result.contains("snoozeBG")) snoozeBG = result.getDouble("snoozeBG"); if (result.contains("rate")) { rate = result.getDouble("rate"); if (rate < 0d) rate = 0d;