From cfe4df64b1dc94717517a033b8ef60139dd3e12b Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 28 Aug 2017 16:03:30 +0200 Subject: [PATCH] catch exceptions thrown at deleting CalDAV events --- .../com/simplemobiletools/calendar/helpers/CalDAVHandler.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/CalDAVHandler.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/CalDAVHandler.kt index 05402b45f..d89891161 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/CalDAVHandler.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/CalDAVHandler.kt @@ -364,7 +364,11 @@ class CalDAVHandler(val context: Context) { fun deleteCalDAVEvent(event: Event) { val uri = CalendarContract.Events.CONTENT_URI val contentUri = ContentUris.withAppendedId(uri, event.getCalDAVEventId()) - context.contentResolver.delete(contentUri, null, null) + try { + context.contentResolver.delete(contentUri, null, null) + } catch (ignored: SecurityException) { + + } } private fun getCalDAVEventReminders(eventId: Long): List {