add a null check to dayfragment

This commit is contained in:
tibbi 2016-09-19 22:18:19 +02:00
parent dfa8f739e9
commit 711736cbeb

View File

@ -124,6 +124,9 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte
private fun updateEvents(events: MutableList<Event>) {
mEvents = ArrayList(events)
val eventsToShow = getEventsToShow(events)
if (activity == null)
return
val eventsAdapter = EventsAdapter(activity.baseContext, eventsToShow)
mHolder.day_events.apply {
adapter = eventsAdapter