fix nullpointerexception in reading temp basal status

This commit is contained in:
Milos Kozak 2017-02-09 16:39:07 +01:00
parent caa109dbfd
commit a39416d876
2 changed files with 10 additions and 8 deletions

View file

@ -709,11 +709,12 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
extended.put("PumpIOB", getDanaRPump().iob);
extended.put("LastBolus", getDanaRPump().lastBolusTime.toLocaleString());
extended.put("LastBolusAmount", getDanaRPump().lastBolusAmount);
if (isTempBasalInProgress()) {
TempBasal tb = getTempBasal();
if (tb != null) {
extended.put("TempBasalAbsoluteRate", getTempBasalAbsoluteRate());
extended.put("TempBasalStart", getTempBasal().timeStart.toLocaleString());
extended.put("TempBasalRemaining", getTempBasal().getPlannedRemainingMinutes());
extended.put("IsExtended", getTempBasal().isExtended);
extended.put("TempBasalStart", tb.timeStart.toLocaleString());
extended.put("TempBasalRemaining", tb.getPlannedRemainingMinutes());
extended.put("IsExtended", tb.isExtended);
}
extended.put("BaseBasalRate", getBaseBasalRate());
try {

View file

@ -709,11 +709,12 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
extended.put("PumpIOB", getDanaRPump().iob);
// extended.put("LastBolus", getDanaRPump().lastBolusTime.toLocaleString());
// extended.put("LastBolusAmount", getDanaRPump().lastBolusAmount);
if (isTempBasalInProgress()) {
TempBasal tb = getTempBasal();
if (tb != null) {
extended.put("TempBasalAbsoluteRate", getTempBasalAbsoluteRate());
extended.put("TempBasalStart", getTempBasal().timeStart.toLocaleString());
extended.put("TempBasalRemaining", getTempBasal().getPlannedRemainingMinutes());
extended.put("IsExtended", getTempBasal().isExtended);
extended.put("TempBasalStart", tb.timeStart.toLocaleString());
extended.put("TempBasalRemaining", tb.getPlannedRemainingMinutes());
extended.put("IsExtended", tb.isExtended);
}
extended.put("BaseBasalRate", getBaseBasalRate());
try {