forked from github/wulkanowy-mirror
Fix NPE in timetable dashboard tile (#1498)
This commit is contained in:
parent
16a5d88dfb
commit
7217d0f753
@ -31,6 +31,7 @@ import io.github.wulkanowy.utils.getThemeAttrColor
|
|||||||
import io.github.wulkanowy.utils.left
|
import io.github.wulkanowy.utils.left
|
||||||
import io.github.wulkanowy.utils.nickOrName
|
import io.github.wulkanowy.utils.nickOrName
|
||||||
import io.github.wulkanowy.utils.toFormattedString
|
import io.github.wulkanowy.utils.toFormattedString
|
||||||
|
import timber.log.Timber
|
||||||
import java.time.Duration
|
import java.time.Duration
|
||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
@ -429,7 +430,10 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
val minutesToEndLesson = firstLesson.left!!.toMinutes() + 1
|
val minutesToEndLesson = firstLesson.left?.toMinutes()?.plus(1) ?: run {
|
||||||
|
Timber.e(IllegalArgumentException("Lesson left is null. START ${firstLesson.start} ; END ${firstLesson.end} ; CURRENT ${LocalDateTime.now()}"))
|
||||||
|
0
|
||||||
|
}
|
||||||
|
|
||||||
firstTimeText = context.resources.getQuantityString(
|
firstTimeText = context.resources.getQuantityString(
|
||||||
R.plurals.dashboard_timetable_first_lesson_time_more_minutes,
|
R.plurals.dashboard_timetable_first_lesson_time_more_minutes,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user