mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-19 00:16:48 -06:00
Fix timetable widget crash when there are no lessons for the day (#1737)
This commit is contained in:
parent
210c3a0e28
commit
ba02531aa4
@ -73,13 +73,12 @@ class TimetableWidgetFactory(
|
||||
updateTheme(appWidgetId)
|
||||
lessons = getLessons(date, studentId)
|
||||
|
||||
if (date == LocalDate.now()) {
|
||||
val todayLastLessonEndTimestamp =
|
||||
lessons.maxOf { it.end }.toEpochSecond(ZoneOffset.UTC)
|
||||
val todayLastLessonEndTimestamp = lessons.maxOfOrNull { it.end }
|
||||
if (date == LocalDate.now() && todayLastLessonEndTimestamp != null) {
|
||||
sharedPref.putLong(
|
||||
getTodayLastLessonEndDateTimeWidgetKey(appWidgetId),
|
||||
todayLastLessonEndTimestamp,
|
||||
true
|
||||
key = getTodayLastLessonEndDateTimeWidgetKey(appWidgetId),
|
||||
value = todayLastLessonEndTimestamp.toEpochSecond(ZoneOffset.UTC),
|
||||
sync = true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user