fix NPE
This commit is contained in:
parent
42714afeb1
commit
5499396661
1 changed files with 4 additions and 0 deletions
|
@ -208,6 +208,10 @@ public class DataService extends IntentService {
|
||||||
double insulin = JsonHelper.safeGetDouble(json, "insulin");
|
double insulin = JsonHelper.safeGetDouble(json, "insulin");
|
||||||
double carbs = JsonHelper.safeGetDouble(json, "carbs");
|
double carbs = JsonHelper.safeGetDouble(json, "carbs");
|
||||||
String eventType = JsonHelper.safeGetString(json, "eventType");
|
String eventType = JsonHelper.safeGetString(json, "eventType");
|
||||||
|
if (eventType == null) {
|
||||||
|
log.debug("Wrong treatment. Ignoring : " + json.toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (insulin > 0 || carbs > 0) {
|
if (insulin > 0 || carbs > 0) {
|
||||||
EventNsTreatment evtTreatment = new EventNsTreatment(mode, json);
|
EventNsTreatment evtTreatment = new EventNsTreatment(mode, json);
|
||||||
MainApp.bus().post(evtTreatment);
|
MainApp.bus().post(evtTreatment);
|
||||||
|
|
Loading…
Reference in a new issue