diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/mobidziennik/data/web/MobidziennikWebAttendance.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/mobidziennik/data/web/MobidziennikWebAttendance.kt index f23478b6..cbd797b1 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/mobidziennik/data/web/MobidziennikWebAttendance.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/mobidziennik/data/web/MobidziennikWebAttendance.kt @@ -48,7 +48,7 @@ class MobidziennikWebAttendance(override val data: DataMobidziennik, //syncWeeks.clear() //syncWeeks += Date.fromY_m_d("2019-12-19") - syncWeeks.minBy { it.value }?.let { + syncWeeks.minByOrNull { it.value }?.let { data.toRemove.add(DataRemoveModel.Attendance.from(it)) } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.kt index 7550b08c..aaebbac0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.kt @@ -76,7 +76,7 @@ class LoginProgressFragment : Fragment(), CoroutineScope { val maxProfileId = max( app.db.profileDao().lastId ?: 0, - activity.profiles.maxBy { it.profile.id }?.profile?.id ?: 0 + activity.profiles.maxByOrNull { it.profile.id }?.profile?.id ?: 0 ) val loginType = args.getInt("loginType", -1) val loginMode = args.getInt("loginMode", 0) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableFragment.kt index 970daeec..85332fe1 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableFragment.kt @@ -120,8 +120,8 @@ class TimetableFragment : Fragment(), CoroutineScope { } val lessonRanges = app.db.lessonRangeDao().getAllNow(App.profileId) - startHour = lessonRanges.map { it.startTime.hour }.min() ?: DEFAULT_START_HOUR - endHour = lessonRanges.map { it.endTime.hour }.max()?.plus(1) ?: DEFAULT_END_HOUR + startHour = lessonRanges.map { it.startTime.hour }.minOrNull() ?: DEFAULT_START_HOUR + endHour = lessonRanges.map { it.endTime.hour }.maxOrNull()?.plus(1) ?: DEFAULT_END_HOUR } deferred.await() if (!isAdded) diff --git a/build.gradle b/build.gradle index 9214ceda..ac506325 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ buildscript { ext { - kotlin_version = '1.4.31' + kotlin_version = '1.5.20' release = [ versionName: "4.8.2",