From b9b08c15288d3c4a3a0722402f4ffe8ed4d177a7 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 9 Feb 2017 16:29:02 +0100 Subject: [PATCH] fix crash when pump status not loaded yet --- .../info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java | 2 ++ .../androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java index 577e1d3bcf..791e7a0c8d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java @@ -258,6 +258,8 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf if (!isInitialized()) return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS DanaRPump pump = getDanaRPump(); + if (pump.pumpProfiles == null) + return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS int basalValues = pump.basal48Enable ? 48 : 24; int basalIncrement = pump.basal48Enable ? 30 * 60 : 60 * 60; for (int h = 0; h < basalValues; h++) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java index e5b40a60a5..78c42a0f2e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java @@ -258,6 +258,8 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints if (!isInitialized()) return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS DanaRKoreanPump pump = getDanaRPump(); + if (pump.pumpProfiles == null) + return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS int basalValues = pump.basal48Enable ? 48 : 24; int basalIncrement = pump.basal48Enable ? 30 * 60 : 60 * 60; for (int h = 0; h < basalValues; h++) {