adding some crashfixes

This commit is contained in:
tibbi 2020-05-25 20:56:14 +02:00
parent decfcbe1bf
commit 12e09bdb73
2 changed files with 15 additions and 10 deletions

View File

@ -48,7 +48,10 @@ class EventListWidgetAdapter(val context: Context) : RemoteViewsService.RemoteVi
setupListEvent(remoteView, event) setupListEvent(remoteView, event)
} else { } else {
remoteView = RemoteViews(context.packageName, R.layout.event_list_section_widget) remoteView = RemoteViews(context.packageName, R.layout.event_list_section_widget)
setupListSection(remoteView, events[position] as ListSection) val section = events.getOrNull(position) as? ListSection
if (section != null) {
setupListSection(remoteView, section)
}
} }
return remoteView return remoteView

View File

@ -164,8 +164,10 @@ class WeekFragment : Fragment(), WeeklyCalendar {
} }
fun updateCalendar() { fun updateCalendar() {
if (context != null) {
WeeklyCalendarImpl(this, context!!).updateWeeklyCalendar(weekTimestamp) WeeklyCalendarImpl(this, context!!).updateWeeklyCalendar(weekTimestamp)
} }
}
private fun setupDayLabels() { private fun setupDayLabels() {
var curDay = Formatter.getDateTimeFromTS(weekTimestamp) var curDay = Formatter.getDateTimeFromTS(weekTimestamp)