From c30f105be558acac6a783e40116f22fc65aefd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Mon, 7 Sep 2020 09:35:26 +0200 Subject: [PATCH] Fix crash on unknown attendance category type (#949) --- app/build.gradle | 2 +- .../main/java/io/github/wulkanowy/utils/AttendanceExtension.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2d608f973..cb7995d40 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -126,7 +126,7 @@ configurations.all { } dependencies { - implementation "io.github.wulkanowy:sdk:0.20.3" + implementation "io.github.wulkanowy:sdk:0faa503" coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10' diff --git a/app/src/main/java/io/github/wulkanowy/utils/AttendanceExtension.kt b/app/src/main/java/io/github/wulkanowy/utils/AttendanceExtension.kt index 92e8661fe..f10b00a07 100644 --- a/app/src/main/java/io/github/wulkanowy/utils/AttendanceExtension.kt +++ b/app/src/main/java/io/github/wulkanowy/utils/AttendanceExtension.kt @@ -27,7 +27,7 @@ private fun calculatePercentage(presence: Double, absence: Double): Double { } inline val Attendance.description - get() = when (AttendanceCategory.valueOf(name)) { + get() = when (AttendanceCategory.getCategoryByName(name)) { AttendanceCategory.PRESENCE -> R.string.attendance_present AttendanceCategory.ABSENCE_UNEXCUSED -> R.string.attendance_absence_unexcused AttendanceCategory.ABSENCE_EXCUSED -> R.string.attendance_absence_excused