From 3f453685d33215dbc6e9d289ce925ac430550f32 Mon Sep 17 00:00:00 2001 From: Codeelements_Ruhe Date: Mon, 10 Jul 2023 11:55:40 +0200 Subject: [PATCH] fixed crash in RegularJourneyContentFragment --- .../ui/timetable/journey/RegularJourneyContentFragment.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/core/src/main/java/de/deutschebahn/bahnhoflive/ui/timetable/journey/RegularJourneyContentFragment.kt b/modules/core/src/main/java/de/deutschebahn/bahnhoflive/ui/timetable/journey/RegularJourneyContentFragment.kt index 3a01f668..2f3b08bf 100644 --- a/modules/core/src/main/java/de/deutschebahn/bahnhoflive/ui/timetable/journey/RegularJourneyContentFragment.kt +++ b/modules/core/src/main/java/de/deutschebahn/bahnhoflive/ui/timetable/journey/RegularJourneyContentFragment.kt @@ -209,11 +209,13 @@ class RegularJourneyContentFragment : Fragment() { textWagonOrder.isGone = buttonWagonOrder.isGone - val lastStation = journeyStops.last() + if(journeyStops.isNotEmpty()) { // empty happens if train is cancelled !! + val lastStation = journeyStops.last() - sev.visibility = - if (SEV_Static.isReplacementStopFrom(lastStation.evaId)) View.VISIBLE else View.GONE + sev.visibility = + if (SEV_Static.isReplacementStopFrom(lastStation.evaId)) View.VISIBLE else View.GONE // default=gone + } }, { Log.d(RegularJourneyContentFragment::class.java.simpleName, "Error: $it")