From 2ce08260bfcefd12852acf6921cd2377ff2a0ecc Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 23 Apr 2017 09:47:27 +0200 Subject: [PATCH] do not calculate autosens when no bg data available --- .../nightscout/androidaps/plugins/OpenAPSAMA/Autosens.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/Autosens.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/Autosens.java index b504dde984..1c02842ddc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/Autosens.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/Autosens.java @@ -25,6 +25,9 @@ public class Autosens { //console.error(mealTime); + if (glucose_data.size() < 3) + return new AutosensResult(); + double deviationSum = 0; double carbsAbsorbed = 0;