diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListAdapter.kt index d68c9174e..026459b96 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListAdapter.kt @@ -189,8 +189,11 @@ class EventListAdapter(activity: SimpleActivity, var listItems: ArrayList(selectedPositions.size) selectedPositions.forEach { - eventIds.add((listItems[it] as ListEvent).id) - timestamps.add((listItems[it] as ListEvent).startTS) + val item = listItems[it] + if (item is ListEvent) { + eventIds.add(item.id) + timestamps.add(item.startTS) + } } DeleteEventDialog(activity, eventIds) {