diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/ManageEventTypesActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/ManageEventTypesActivity.kt index 46f08d2b6..d705d8dfe 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/ManageEventTypesActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/ManageEventTypesActivity.kt @@ -25,7 +25,7 @@ class ManageEventTypesActivity : SimpleActivity(), DeleteEventTypesListener { } private fun showEventTypeDialog(eventType: EventType? = null) { - UpdateEventTypeDialog(this, eventType!!.copy()) { + UpdateEventTypeDialog(this, eventType?.copy()) { getEventTypes() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/models/Event.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/models/Event.kt index 5a9c295d2..6148dad3c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/models/Event.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/models/Event.kt @@ -104,7 +104,7 @@ data class Event(var id: Int = 0, var startTS: Int = 0, var endTS: Int = 0, var } } - fun getCalDAVEventId() = (importId.split("-").lastOrNull() ?: "0").toString().toLong() + fun getCalDAVEventId() = if (importId.contains("-")) (importId.split("-").lastOrNull() ?: "0").toString().toLong() else 0L - fun getCalDAVCalendarId() = (source.split("-").lastOrNull() ?: "0").toString().toInt() + fun getCalDAVCalendarId() = if (source.contains("-")) (source.split("-").lastOrNull() ?: "0").toString().toInt() else 0 }