From 5d3de35c1056e2fd1b9524234722b057f3e14774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Mon, 2 Dec 2019 22:20:53 +0100 Subject: [PATCH] [UI/Timetable] Fix non-null cast exception. --- .../ui/modules/timetable/v2/day/TimetableDayFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/v2/day/TimetableDayFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/v2/day/TimetableDayFragment.kt index 240e4e33..8ab48016 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/v2/day/TimetableDayFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/v2/day/TimetableDayFragment.kt @@ -120,7 +120,7 @@ class TimetableDayFragment : Fragment(), CoroutineScope { private fun processLessonList(lessons: List, events: List) { // no lessons - timetable not downloaded yet if (lessons.isEmpty()) { - inflater.inflate(R.layout.timetable_no_timetable, view as FrameLayout) { view, _, parent -> + inflater.inflate(R.layout.timetable_no_timetable, view as FrameLayout?) { view, _, parent -> parent?.removeAllViews() parent?.addView(view) val b = TimetableNoTimetableBinding.bind(view) @@ -143,7 +143,7 @@ class TimetableDayFragment : Fragment(), CoroutineScope { } // one lesson indicating a day without lessons if (lessons.size == 1 && lessons[0].type == Lesson.TYPE_NO_LESSONS) { - inflater.inflate(R.layout.timetable_no_lessons, view as FrameLayout) { view, _, parent -> + inflater.inflate(R.layout.timetable_no_lessons, view as FrameLayout?) { view, _, parent -> parent?.removeAllViews() parent?.addView(view) }