Panagiotis Triantafyllou

fixed pacing

......@@ -155,13 +155,13 @@ public class PacingDetails {
this.total = new PacingDetailsInner(json.optJSONObject(TOTAL));
}
if (json.optJSONObject(MONTH) != null) {
this.total = new PacingDetailsInner(json.optJSONObject(MONTH));
this.month = new PacingDetailsInner(json.optJSONObject(MONTH));
}
if (json.optJSONObject(WEEK) != null) {
this.total = new PacingDetailsInner(json.optJSONObject(WEEK));
this.week = new PacingDetailsInner(json.optJSONObject(WEEK));
}
if (json.optJSONObject(DAY) != null) {
this.total = new PacingDetailsInner(json.optJSONObject(DAY));
this.day = new PacingDetailsInner(json.optJSONObject(DAY));
}
}
}
......@@ -216,8 +216,8 @@ public class PacingDetails {
public PacingDetailsInner(JSONObject json) {
if (json != null) {
this.goal = json.optDouble(GOAL);
this.value = json.optDouble(VALLUE);
this.goal = json.optDouble(GOAL, 0.0d);
this.value = json.optDouble(VALLUE, 0.0d);
if (json.optJSONArray(PER_DAY) != null) {
JSONArray perDay = new JSONArray();
perDay = json.optJSONArray(PER_DAY);
......@@ -275,7 +275,7 @@ public class PacingDetails {
public PacingDetailsDay(JSONObject json) {
if (json != null) {
this.day = json.optString(DAY);
this.value = json.optDouble(VALLUE);
this.value = json.optDouble(VALLUE, 0.0d);
}
}
......