resolve NPE on app start in xdrip status line
This commit is contained in:
parent
81d36a83b2
commit
44c50804a8
1 changed files with 10 additions and 0 deletions
|
@ -33,6 +33,7 @@ import info.nightscout.androidaps.events.EventReloadProfileSwitchData;
|
||||||
import info.nightscout.androidaps.events.EventReloadTempBasalData;
|
import info.nightscout.androidaps.events.EventReloadTempBasalData;
|
||||||
import info.nightscout.androidaps.events.EventReloadTreatmentData;
|
import info.nightscout.androidaps.events.EventReloadTreatmentData;
|
||||||
import info.nightscout.androidaps.events.EventTempTargetChange;
|
import info.nightscout.androidaps.events.EventTempTargetChange;
|
||||||
|
import info.nightscout.androidaps.interfaces.InsulinInterface;
|
||||||
import info.nightscout.androidaps.interfaces.PluginBase;
|
import info.nightscout.androidaps.interfaces.PluginBase;
|
||||||
import info.nightscout.androidaps.interfaces.PluginDescription;
|
import info.nightscout.androidaps.interfaces.PluginDescription;
|
||||||
import info.nightscout.androidaps.interfaces.PluginType;
|
import info.nightscout.androidaps.interfaces.PluginType;
|
||||||
|
@ -181,6 +182,10 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
|
||||||
if (profile == null)
|
if (profile == null)
|
||||||
return total;
|
return total;
|
||||||
|
|
||||||
|
InsulinInterface insulinInterface = MainApp.getConfigBuilder().getActiveInsulin();
|
||||||
|
if (insulinInterface == null)
|
||||||
|
return total;
|
||||||
|
|
||||||
double dia = profile.getDia();
|
double dia = profile.getDia();
|
||||||
|
|
||||||
synchronized (treatments) {
|
synchronized (treatments) {
|
||||||
|
@ -364,6 +369,11 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
|
||||||
|
|
||||||
public IobTotal getCalculationToTimeTempBasals(long time, Profile profile, boolean truncate, long truncateTime) {
|
public IobTotal getCalculationToTimeTempBasals(long time, Profile profile, boolean truncate, long truncateTime) {
|
||||||
IobTotal total = new IobTotal(time);
|
IobTotal total = new IobTotal(time);
|
||||||
|
|
||||||
|
InsulinInterface insulinInterface = MainApp.getConfigBuilder().getActiveInsulin();
|
||||||
|
if (insulinInterface == null)
|
||||||
|
return total;
|
||||||
|
|
||||||
synchronized (tempBasals) {
|
synchronized (tempBasals) {
|
||||||
for (Integer pos = 0; pos < tempBasals.size(); pos++) {
|
for (Integer pos = 0; pos < tempBasals.size(); pos++) {
|
||||||
TemporaryBasal t = tempBasals.get(pos);
|
TemporaryBasal t = tempBasals.get(pos);
|
||||||
|
|
Loading…
Reference in a new issue