check for no profile
This commit is contained in:
parent
7be0bfb27e
commit
a3e6794138
1 changed files with 6 additions and 1 deletions
|
@ -637,6 +637,11 @@ public class WatchUpdaterService extends WearableListenerService implements
|
||||||
private String generateBasalString(TreatmentsInterface treatmentsInterface) {
|
private String generateBasalString(TreatmentsInterface treatmentsInterface) {
|
||||||
|
|
||||||
String basalStringResult;
|
String basalStringResult;
|
||||||
|
|
||||||
|
Profile profile = MainApp.getConfigBuilder().getProfile();
|
||||||
|
if (profile == null)
|
||||||
|
return "";
|
||||||
|
|
||||||
TemporaryBasal activeTemp = treatmentsInterface.getTempBasalFromHistory(System.currentTimeMillis());
|
TemporaryBasal activeTemp = treatmentsInterface.getTempBasalFromHistory(System.currentTimeMillis());
|
||||||
if (activeTemp != null) {
|
if (activeTemp != null) {
|
||||||
basalStringResult = activeTemp.toStringShort();
|
basalStringResult = activeTemp.toStringShort();
|
||||||
|
@ -644,7 +649,7 @@ public class WatchUpdaterService extends WearableListenerService implements
|
||||||
if (SP.getBoolean(R.string.key_danar_visualizeextendedaspercentage, false)) {
|
if (SP.getBoolean(R.string.key_danar_visualizeextendedaspercentage, false)) {
|
||||||
basalStringResult = "100%";
|
basalStringResult = "100%";
|
||||||
} else {
|
} else {
|
||||||
basalStringResult = DecimalFormatter.to2Decimal(MainApp.getConfigBuilder().getProfile().getBasal()) + "U/h";
|
basalStringResult = DecimalFormatter.to2Decimal(profile.getBasal()) + "U/h";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return basalStringResult;
|
return basalStringResult;
|
||||||
|
|
Loading…
Reference in a new issue