mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-31 13:48:20 +01:00
[API/Edudziennik] Fix getting grades with null value.
This commit is contained in:
parent
21fd59c196
commit
a96fcabba5
@ -54,10 +54,10 @@ class EdudziennikWebGrades(override val data: DataEdudziennik,
|
|||||||
subjects.select(".avg-$subjectId .grade-tip > p").first()
|
subjects.select(".avg-$subjectId .grade-tip > p").first()
|
||||||
.text().split('+').map {
|
.text().split('+').map {
|
||||||
val split = it.split('*')
|
val split = it.split('*')
|
||||||
val weight = split[0].trim().toFloat()
|
val value = split[1].trim().toFloatOrNull()
|
||||||
val value = split[1].trim().toFloat()
|
val weight = value?.let { split[0].trim().toFloatOrNull() } ?: 0f
|
||||||
|
|
||||||
Pair(value, weight)
|
Pair(value ?: 0f, weight)
|
||||||
}
|
}
|
||||||
} else emptyList()
|
} else emptyList()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user