fix NPE on temp target sync

This commit is contained in:
Milos Kozak 2018-08-01 14:30:32 +02:00
parent 44c50804a8
commit 22881e17a2

View file

@ -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);