better check for null
This commit is contained in:
parent
74afdb6874
commit
9d8d925f75
2 changed files with 2 additions and 2 deletions
|
@ -97,7 +97,7 @@ public class TempBasalsPlugin implements PluginBase, TempBasalsInterface {
|
||||||
|
|
||||||
private void initializeData() {
|
private void initializeData() {
|
||||||
double dia = 3;
|
double dia = 3;
|
||||||
if (MainApp.getConfigBuilder().getActiveProfile() != null)
|
if (MainApp.getConfigBuilder().getActiveProfile() != null && MainApp.getConfigBuilder().getActiveProfile().getProfile() != null)
|
||||||
dia = MainApp.getConfigBuilder().getActiveProfile().getProfile().getDia();
|
dia = MainApp.getConfigBuilder().getActiveProfile().getProfile().getDia();
|
||||||
long fromMills = (long) (new Date().getTime() - 60 * 60 * 1000L * (24 + dia));
|
long fromMills = (long) (new Date().getTime() - 60 * 60 * 1000L * (24 + dia));
|
||||||
tempBasals = MainApp.getDbHelper().getTempbasalsDataFromTime(fromMills, false, false);
|
tempBasals = MainApp.getDbHelper().getTempbasalsDataFromTime(fromMills, false, false);
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface {
|
||||||
|
|
||||||
public void initializeData() {
|
public void initializeData() {
|
||||||
double dia = 3;
|
double dia = 3;
|
||||||
if (MainApp.getConfigBuilder().getActiveProfile() != null)
|
if (MainApp.getConfigBuilder().getActiveProfile() != null && MainApp.getConfigBuilder().getActiveProfile().getProfile() != null)
|
||||||
dia = MainApp.getConfigBuilder().getActiveProfile().getProfile().getDia();
|
dia = MainApp.getConfigBuilder().getActiveProfile().getProfile().getDia();
|
||||||
long fromMills = (long) (new Date().getTime() - 60 * 60 * 1000L * (24 + dia));
|
long fromMills = (long) (new Date().getTime() - 60 * 60 * 1000L * (24 + dia));
|
||||||
treatments = MainApp.getDbHelper().getTreatmentDataFromTime(fromMills, false);
|
treatments = MainApp.getDbHelper().getTreatmentDataFromTime(fromMills, false);
|
||||||
|
|
Loading…
Reference in a new issue