check for duration in json
This commit is contained in:
parent
a47fe757b9
commit
455383cfd5
|
@ -1353,7 +1353,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
|||
return;
|
||||
}
|
||||
extendedBolus.date = trJson.getLong("mills");
|
||||
extendedBolus.durationInMinutes = trJson.getInt("duration");
|
||||
extendedBolus.durationInMinutes = trJson.has("duration") ? trJson.getInt("duration") : 0;
|
||||
extendedBolus.insulin = trJson.getDouble("relative");
|
||||
extendedBolus._id = trJson.getString("_id");
|
||||
createOrUpdate(extendedBolus);
|
||||
|
|
Loading…
Reference in a new issue