check for null profile in watchupdaterservice

This commit is contained in:
Milos Kozak 2017-06-30 23:59:12 +02:00
parent b4ab1d4109
commit d4537a001f

View file

@ -527,6 +527,12 @@ public class WatchUpdaterService extends WearableListenerService implements
String status = "";
boolean shortString = true;
Profile profile = MainApp.getConfigBuilder().getProfile();
if (profile == null) {
status = MainApp.sResources.getString(R.string.noprofile);
return status;
}
LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop();
if (activeloop != null && !activeloop.isEnabled(PluginBase.LOOP)) {
@ -560,7 +566,6 @@ public class WatchUpdaterService extends WearableListenerService implements
+ DecimalFormatter.to2Decimal(bolusIob.iob) + "|"
+ DecimalFormatter.to2Decimal(basalIob.basaliob) + ")";
}
Profile profile = MainApp.getConfigBuilder().getProfile();
if (!mPrefs.getBoolean("wear_showbgi", false)) {
return status;
}