mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
catch exceptions thrown at parsing caldav event id
This commit is contained in:
@@ -104,7 +104,13 @@ data class Event(var id: Int = 0, var startTS: Int = 0, var endTS: Int = 0, var
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getCalDAVEventId() = if (importId.contains("-")) (importId.split("-").lastOrNull() ?: "0").toString().toLong() else 0L
|
fun getCalDAVEventId(): Long {
|
||||||
|
return try {
|
||||||
|
(importId.split("-").lastOrNull() ?: "0").toString().toLong()
|
||||||
|
} catch (e: NumberFormatException) {
|
||||||
|
0L
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun getCalDAVCalendarId() = if (source.contains("-")) (source.split("-").lastOrNull() ?: "0").toString().toInt() else 0
|
fun getCalDAVCalendarId() = if (source.contains("-")) (source.split("-").lastOrNull() ?: "0").toString().toInt() else 0
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user