From 22881e17a291ef2ad0e30b6386d96de5bdd0d72a Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 1 Aug 2018 14:30:32 +0200 Subject: [PATCH] fix NPE on temp target sync --- .../main/java/info/nightscout/androidaps/db/DatabaseHelper.java | 2 +- 1 file changed, 1 insertion(+), 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 5ef716bad9..cf8ff788e9 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java +++ b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java @@ -698,7 +698,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { .duration(trJson.getInt("duration")) .low(Profile.toMgdl(trJson.getDouble("targetBottom"), units)) .high(Profile.toMgdl(trJson.getDouble("targetTop"), units)) - .reason(trJson.getString("reason")) + .reason(JsonHelper.safeGetString(trJson, "reason", "")) ._id(trJson.getString("_id")) .source(Source.NIGHTSCOUT); createOrUpdate(tempTarget);