adding some crashfixes

This commit is contained in:
tibbi 2017-08-28 08:27:22 +02:00
parent 434c017dd1
commit aa25ce1659
2 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ class ManageEventTypesActivity : SimpleActivity(), DeleteEventTypesListener {
} }
private fun showEventTypeDialog(eventType: EventType? = null) { private fun showEventTypeDialog(eventType: EventType? = null) {
UpdateEventTypeDialog(this, eventType!!.copy()) { UpdateEventTypeDialog(this, eventType?.copy()) {
getEventTypes() getEventTypes()
} }
} }

View File

@ -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
} }