fix npe
This commit is contained in:
parent
ebee1cdeca
commit
b1d5b12f55
2 changed files with 6 additions and 5 deletions
|
@ -37,7 +37,7 @@
|
||||||
<ConfirmationsSetting value="0" id="Add" />
|
<ConfirmationsSetting value="0" id="Add" />
|
||||||
<ConfirmationsSetting value="0" id="Remove" />
|
<ConfirmationsSetting value="0" id="Remove" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|
|
@ -333,10 +333,11 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
|
||||||
try {
|
try {
|
||||||
battery.put("percent", batteryPercent);
|
battery.put("percent", batteryPercent);
|
||||||
status.put("status", "normal");
|
status.put("status", "normal");
|
||||||
if (isTempBasalInProgress()) {
|
TempBasal tb;
|
||||||
status.put("tempbasalpct", getTempBasal().percent);
|
if ((tb = getTempBasal()) != null) {
|
||||||
status.put("tempbasalstart", DateUtil.toISOString(getTempBasal().timeStart));
|
status.put("tempbasalpct", tb.percent);
|
||||||
status.put("tempbasalremainmin", getTempBasal().getPlannedRemainingMinutes());
|
status.put("tempbasalstart", DateUtil.toISOString(tb.timeStart));
|
||||||
|
status.put("tempbasalremainmin", tb.getPlannedRemainingMinutes());
|
||||||
}
|
}
|
||||||
status.put("timestamp", DateUtil.toISOString(new Date()));
|
status.put("timestamp", DateUtil.toISOString(new Date()));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue