use default dia when no profile available

This commit is contained in:
Milos Kozak 2017-06-30 11:18:51 +02:00
parent 51b01a0993
commit 448cf7ea85
2 changed files with 4 additions and 2 deletions

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.InsulinFastacting; package info.nightscout.androidaps.plugins.InsulinFastacting;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.Iob; import info.nightscout.androidaps.data.Iob;
@ -89,7 +90,7 @@ public class InsulinFastactingPlugin implements PluginBase, InsulinInterface {
@Override @Override
public double getDia() { public double getDia() {
return MainApp.getConfigBuilder().getProfile().getDia(); return MainApp.getConfigBuilder().getProfile() != null ? MainApp.getConfigBuilder().getProfile().getDia() : Constants.defaultDIA;
} }
@Override @Override

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.InsulinFastactingProlonged; package info.nightscout.androidaps.plugins.InsulinFastactingProlonged;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.Iob; import info.nightscout.androidaps.data.Iob;
@ -89,7 +90,7 @@ public class InsulinFastactingProlongedPlugin implements PluginBase, InsulinInte
@Override @Override
public double getDia() { public double getDia() {
return MainApp.getConfigBuilder().getProfile().getDia(); return MainApp.getConfigBuilder().getProfile() != null ? MainApp.getConfigBuilder().getProfile().getDia() : Constants.defaultDIA;
} }
@Override @Override