mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-03-30 11:10:06 +02:00
move a null check
This commit is contained in:
parent
b99c74666f
commit
e07c3b9250
@ -52,7 +52,7 @@ class EventListFragment : Fragment(), DBHelper.GetEventsListener, DBHelper.Event
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun gotEvents(events: MutableList<Event>) {
|
override fun gotEvents(events: MutableList<Event>) {
|
||||||
if (context == null)
|
if (context == null || activity == null)
|
||||||
return
|
return
|
||||||
|
|
||||||
val filtered = context.getFilteredEvents(events)
|
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))
|
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) {
|
val eventsAdapter = EventListAdapter(activity as SimpleActivity, listItems, this) {
|
||||||
editEvent(it)
|
editEvent(it)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user