fix a crash at trying to delete an event list section

This commit is contained in:
tibbi 2018-05-09 23:12:18 +02:00
parent 74109796bb
commit caae4a5f58
1 changed files with 5 additions and 2 deletions

View File

@ -189,8 +189,11 @@ class EventListAdapter(activity: SimpleActivity, var listItems: ArrayList<ListIt
val timestamps = ArrayList<Int>(selectedPositions.size) val timestamps = ArrayList<Int>(selectedPositions.size)
selectedPositions.forEach { selectedPositions.forEach {
eventIds.add((listItems[it] as ListEvent).id) val item = listItems[it]
timestamps.add((listItems[it] as ListEvent).startTS) if (item is ListEvent) {
eventIds.add(item.id)
timestamps.add(item.startTS)
}
} }
DeleteEventDialog(activity, eventIds) { DeleteEventDialog(activity, eventIds) {