mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 21:06:44 -06:00
[API/Librus] Fix r() IndexOutOfBounds. Fix Descriptive grades NPE.
This commit is contained in:
parent
3e6b0250d0
commit
554097fc7d
@ -435,6 +435,10 @@ public class Librus implements EdziennikInterface {
|
|||||||
callback.onProgress(PROGRESS_STEP);
|
callback.onProgress(PROGRESS_STEP);
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
if (index > targetEndpoints.size()) {
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
d(TAG, "Called r("+type+", "+endpoint+"). Getting "+targetEndpoints.get(index));
|
d(TAG, "Called r("+type+", "+endpoint+"). Getting "+targetEndpoints.get(index));
|
||||||
switch (targetEndpoints.get(index)) {
|
switch (targetEndpoints.get(index)) {
|
||||||
case "Me":
|
case "Me":
|
||||||
@ -2409,7 +2413,15 @@ public class Librus implements EdziennikInterface {
|
|||||||
long teacherId = grade.get("AddedBy").getAsJsonObject().get("Id").getAsLong();
|
long teacherId = grade.get("AddedBy").getAsJsonObject().get("Id").getAsLong();
|
||||||
int semester = grade.get("Semester").getAsInt();
|
int semester = grade.get("Semester").getAsInt();
|
||||||
long subjectId = grade.get("Subject").getAsJsonObject().get("Id").getAsLong();
|
long subjectId = grade.get("Subject").getAsJsonObject().get("Id").getAsLong();
|
||||||
String description = grade.get("Map").getAsString();
|
JsonElement map = grade.get("Map");
|
||||||
|
JsonElement realGrade = grade.get("RealGradeValue");
|
||||||
|
String description = "";
|
||||||
|
if (map != null) {
|
||||||
|
description = map.getAsString();
|
||||||
|
}
|
||||||
|
else if (realGrade != null) {
|
||||||
|
description = realGrade.getAsString();
|
||||||
|
}
|
||||||
|
|
||||||
long categoryId = -1;
|
long categoryId = -1;
|
||||||
JsonElement skillEl = grade.get("Skill");
|
JsonElement skillEl = grade.get("Skill");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user