From 3bfecd6da8c751374998638abee331c290027390 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 7 Aug 2017 16:13:09 +0200 Subject: [PATCH] check for existing --- .../java/info/nightscout/androidaps/db/DatabaseHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java index 562085996a..21fc5a47a8 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java +++ b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java @@ -689,7 +689,8 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { treatment.insulin = trJson.has("insulin") ? trJson.getDouble("insulin") : 0d; treatment.pumpId = trJson.has("pumpId") ? trJson.getLong("pumpId") : 0; treatment._id = trJson.getString("_id"); - treatment.isSMB = trJson.getBoolean("isSMB"); + if (trJson.has("isSMB")) + treatment.isSMB = trJson.getBoolean("isSMB"); if (trJson.has("eventType")) { treatment.mealBolus = !trJson.get("eventType").equals("Correction Bolus"); double carbs = treatment.carbs; @@ -1267,6 +1268,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { scheduleExtendedBolusChange(); } } + public ExtendedBolus findExtendedBolusById(String _id) { try { QueryBuilder queryBuilder = null;