diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index 6a18084b5e..c444603090 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -1013,6 +1013,8 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain } public Profile getProfile(long time) { + if (activeTreatments == null) + return null; //app not initialized //log.debug("Profile for: " + new Date(time).toLocaleString() + " : " + getProfileName(time)); ProfileSwitch profileSwitch = getProfileSwitchFromHistory(time); if (profileSwitch != null) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java index 26bfd6741c..da7668776a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java @@ -303,6 +303,8 @@ public class IobCobCalculatorPlugin implements PluginBase { public void calculateSensitivityData() { if (MainApp.getConfigBuilder() == null) return; // app still initializing + if (MainApp.getConfigBuilder().getProfile() == null) + return; // app still initializing //log.debug("Locking calculateSensitivityData"); synchronized (dataLock) {