Prevent NPE during Pod activation
This commit is contained in:
parent
52a01b0a81
commit
cab349dd0a
1 changed files with 6 additions and 3 deletions
|
@ -567,8 +567,11 @@ public abstract class PodStateManager {
|
|||
podState.setTotalTicksDelivered(status.getTicksDelivered());
|
||||
podState.setPodProgressStatus(status.getPodProgressStatus());
|
||||
podState.setTimeActive(status.getTimeActive());
|
||||
|
||||
boolean isBasalCertain = podState.isBasalCertain() == null || podState.isBasalCertain();
|
||||
boolean isTempBasalCertain = podState.isTempBasalCertain() == null || podState.isTempBasalCertain();
|
||||
if (!status.getDeliveryStatus().isTbrRunning()) {
|
||||
if (podState.isTempBasalCertain()) {
|
||||
if (isTempBasalCertain) {
|
||||
clearTempBasal(); // Triggers onTbrChanged when appropriate
|
||||
} else {
|
||||
// Don't trigger onTbrChanged as we will trigger onUncertainTbrRecovered below
|
||||
|
@ -577,11 +580,11 @@ public abstract class PodStateManager {
|
|||
podState.setTempBasalDuration(null);
|
||||
}
|
||||
}
|
||||
if (!podState.isTempBasalCertain()) {
|
||||
if (!isTempBasalCertain) {
|
||||
podState.setTempBasalCertain(true);
|
||||
onUncertainTbrRecovered();
|
||||
}
|
||||
if (!podState.isBasalCertain()) {
|
||||
if (!isBasalCertain) {
|
||||
podState.setBasalCertain(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue