check for existing value

This commit is contained in:
Milos Kozak 2017-07-25 19:18:51 +02:00
parent 3500e92a41
commit d6cb8ef6bc

View file

@ -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")) {