fix NPE when profile not loaded
This commit is contained in:
parent
648b918e3a
commit
aea47420e1
1 changed files with 4 additions and 2 deletions
|
@ -538,8 +538,10 @@ public class WatchUpdaterService extends WearableListenerService implements
|
||||||
//bgi
|
//bgi
|
||||||
String bgiString = "";
|
String bgiString = "";
|
||||||
Profile profile = MainApp.getConfigBuilder().getProfile();
|
Profile profile = MainApp.getConfigBuilder().getProfile();
|
||||||
double bgi = -(bolusIob.activity + basalIob.activity) * 5 * profile.getIsf();
|
if(profile!=null) {
|
||||||
bgiString = "" + ((bgi >= 0) ? "+" : "") + DecimalFormatter.to1Decimal(bgi);
|
double bgi = -(bolusIob.activity + basalIob.activity) * 5 * profile.getIsf();
|
||||||
|
bgiString = "" + ((bgi >= 0) ? "+" : "") + DecimalFormatter.to1Decimal(bgi);
|
||||||
|
}
|
||||||
|
|
||||||
String status = generateStatusString(profile, tempBasal,iobSum, iobDetail, bgiString);
|
String status = generateStatusString(profile, tempBasal,iobSum, iobDetail, bgiString);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue