better check for app initialization
This commit is contained in:
parent
dbd721319e
commit
ab63c2fb48
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue