From d6cb8ef6bcaeaf54f6db240e00d59973ca25fdc9 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 25 Jul 2017 19:18:51 +0200 Subject: [PATCH] check for existing value --- .../java/info/nightscout/androidaps/Services/DataService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/Services/DataService.java b/app/src/main/java/info/nightscout/androidaps/Services/DataService.java index 40cbbf3c52..3b04c30d94 100644 --- a/app/src/main/java/info/nightscout/androidaps/Services/DataService.java +++ b/app/src/main/java/info/nightscout/androidaps/Services/DataService.java @@ -506,7 +506,7 @@ public class DataService extends IntentService { MainApp.getDbHelper().createCareportalEventFromJsonIfNotExists(trJson); } - if (trJson.getString("eventType").equals(CareportalEvent.ANNOUNCEMENT)) { + if (trJson.has("eventType") && trJson.getString("eventType").equals(CareportalEvent.ANNOUNCEMENT)) { long date = trJson.getLong("mills"); long now = System.currentTimeMillis(); if (date > now - 15 * 60 * 1000L && trJson.has("notes")) {