move a null check

This commit is contained in:
tibbi 2017-02-12 18:34:23 +01:00
parent b99c74666f
commit e07c3b9250

View File

@ -52,7 +52,7 @@ class EventListFragment : Fragment(), DBHelper.GetEventsListener, DBHelper.Event
}
override fun gotEvents(events: MutableList<Event>) {
if (context == null)
if (context == null || activity == null)
return
val filtered = context.getFilteredEvents(events)
@ -76,9 +76,6 @@ class EventListFragment : Fragment(), DBHelper.GetEventsListener, DBHelper.Event
listItems.add(ListEvent(it.id, it.startTS, it.endTS, it.title, it.description, it.isAllDay))
}
if (activity == null)
return
val eventsAdapter = EventListAdapter(activity as SimpleActivity, listItems, this) {
editEvent(it)
}