From d2815e404578d8eb5bb063ff368e0806a684e2b1 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 18 Sep 2017 21:52:06 +0200 Subject: [PATCH] check for NaN --- .../SensitivityWeightedAveragePlugin.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityWeightedAverage/SensitivityWeightedAveragePlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityWeightedAverage/SensitivityWeightedAveragePlugin.java index b957e21bda..a10905dbc1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityWeightedAverage/SensitivityWeightedAveragePlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityWeightedAverage/SensitivityWeightedAveragePlugin.java @@ -172,6 +172,10 @@ public class SensitivityWeightedAveragePlugin implements PluginBase, Sensitivity weightedsum += weight * value; } + if (weights == 0) { + return new AutosensResult(); + } + Profile profile = MainApp.getConfigBuilder().getProfile(); double sens = profile.getIsf();