fixed mensa screen crash if day has no meals

This commit is contained in:
Jannik 2019-04-08 14:04:26 +02:00
parent fe111ac56b
commit 77757ad9ca

View File

@ -78,7 +78,9 @@ class MensaFragment : Fragment() {
for (dayIndex in dayStart..4) {
var helpMeal = MealLinearLayout(context)
val dayCardView = DayCardView(context!!)
dayCardView.setDayHeading(menusWeek.days[dayIndex].meals[0].day)
if(menusWeek.days[dayIndex].meals.isNotEmpty())
dayCardView.setDayHeading(menusWeek.days[dayIndex].meals[0].day)
for (meal in menusWeek.days[dayIndex].meals) {
val mealLayout = MealLinearLayout(context)