This commit is contained in:
Milos Kozak 2018-09-04 22:26:59 +02:00
parent 42714afeb1
commit 5499396661

View file

@ -208,6 +208,10 @@ public class DataService extends IntentService {
double insulin = JsonHelper.safeGetDouble(json, "insulin");
double carbs = JsonHelper.safeGetDouble(json, "carbs");
String eventType = JsonHelper.safeGetString(json, "eventType");
if (eventType == null) {
log.debug("Wrong treatment. Ignoring : " + json.toString());
return;
}
if (insulin > 0 || carbs > 0) {
EventNsTreatment evtTreatment = new EventNsTreatment(mode, json);
MainApp.bus().post(evtTreatment);