From 711de0f77f0954d78b70c2e7d5689aa8bada7919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Tue, 26 Sep 2023 22:26:19 +0200 Subject: [PATCH] Fix average calculation when there is no real semesters available (#2310) --- .../github/wulkanowy/ui/modules/grade/GradeAverageProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradeAverageProvider.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradeAverageProvider.kt index 2d63aae4..ec4bd8e8 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradeAverageProvider.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradeAverageProvider.kt @@ -58,7 +58,7 @@ class GradeAverageProvider @Inject constructor( when (params.gradeAverageMode) { ONE_SEMESTER -> getGradeSubjects( student = student, - semester = semesters.single { it.semesterId == semesterId }, + semester = semesters.first { it.semesterId == semesterId }, forceRefresh = forceRefresh, params = params, )