From 1a76809f33b90b0f28e9b2a3d96d35bbc5d87492 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 22 Apr 2017 11:27:56 +0200 Subject: [PATCH] more checking for null --- .../androidaps/plugins/NSClientInternal/data/NSProfile.java | 2 +- .../androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/data/NSProfile.java b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/data/NSProfile.java index 5ff95ddf39..f033849f0c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/data/NSProfile.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/data/NSProfile.java @@ -120,7 +120,7 @@ public class NSProfile { e.printStackTrace(); } } - return 3D; + return Constants.defaultDIA; } /* public Double getCarbAbsorbtionRate() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java index 2cbffae52a..668c205287 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java @@ -142,7 +142,7 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface { return; } - if (profile == null) { + if (profile == null || profile.getIc(NSProfile.secondsFromMidnight()) == null || profile.getIsf(NSProfile.secondsFromMidnight()) == null || profile.getBasal(NSProfile.secondsFromMidnight()) == null ) { MainApp.bus().post(new EventOpenAPSUpdateResultGui(MainApp.instance().getString(R.string.openapsma_noprofile))); if (Config.logAPSResult) log.debug(MainApp.instance().getString(R.string.openapsma_noprofile));