Abort APS run if AS requested but not yet available.
Should only occur during startup or when something else is broken already, so just return.
This commit is contained in:
parent
b435c09771
commit
777542dbb8
2 changed files with 11 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.OpenAPSAMA;
|
||||
|
||||
import info.nightscout.androidaps.plugins.IobCobCalculator.AutosensData;
|
||||
import org.json.JSONException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -173,7 +174,10 @@ public class OpenAPSAMAPlugin extends PluginBase implements APSInterface {
|
|||
|
||||
startPart = new Date();
|
||||
if (MainApp.getConstraintChecker().isAutosensModeEnabled().value()) {
|
||||
lastAutosensResult = IobCobCalculatorPlugin.getPlugin().getLastAutosensDataSynchronized("OpenAPSPlugin").autosensResult;
|
||||
AutosensData autosensData = IobCobCalculatorPlugin.getPlugin().getLastAutosensDataSynchronized("OpenAPSPlugin");
|
||||
if (autosensData == null) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
lastAutosensResult = new AutosensResult();
|
||||
lastAutosensResult.sensResult = "autosens disabled";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.OpenAPSSMB;
|
||||
|
||||
import info.nightscout.androidaps.plugins.IobCobCalculator.AutosensData;
|
||||
import org.json.JSONException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -180,7 +181,11 @@ public class OpenAPSSMBPlugin extends PluginBase implements APSInterface {
|
|||
|
||||
startPart = new Date();
|
||||
if (MainApp.getConstraintChecker().isAutosensModeEnabled().value()) {
|
||||
lastAutosensResult = IobCobCalculatorPlugin.getPlugin().getLastAutosensDataSynchronized("OpenAPSPlugin").autosensResult;
|
||||
AutosensData autosensData = IobCobCalculatorPlugin.getPlugin().getLastAutosensDataSynchronized("OpenAPSPlugin");
|
||||
if (autosensData == null) {
|
||||
return;
|
||||
}
|
||||
lastAutosensResult = autosensData.autosensResult;
|
||||
} else {
|
||||
lastAutosensResult = new AutosensResult();
|
||||
lastAutosensResult.sensResult = "autosens disabled";
|
||||
|
|
Loading…
Reference in a new issue