diff --git a/app/src/main/java/org/tasks/caldav/iCalendar.kt b/app/src/main/java/org/tasks/caldav/iCalendar.kt index fab11c4d0..f27cf72ea 100644 --- a/app/src/main/java/org/tasks/caldav/iCalendar.kt +++ b/app/src/main/java/org/tasks/caldav/iCalendar.kt @@ -46,8 +46,15 @@ class iCalendar @Inject constructor( } fun fromVtodo(vtodo: String): Task? { - val tasks = tasksFromReader(StringReader(vtodo)) - return if (tasks.size == 1) tasks[0] else null + try { + val tasks = tasksFromReader(StringReader(vtodo)) + if (tasks.size == 1) { + return tasks[0] + } + } catch (e: Exception) { + Timber.e(e) + } + return null } fun getParent(remote: Task): String? { diff --git a/app/src/main/java/org/tasks/etesync/EteSynchronizer.java b/app/src/main/java/org/tasks/etesync/EteSynchronizer.java index 46cd436dc..5de62c2a3 100644 --- a/app/src/main/java/org/tasks/etesync/EteSynchronizer.java +++ b/app/src/main/java/org/tasks/etesync/EteSynchronizer.java @@ -237,6 +237,9 @@ public class EteSynchronizer { String vtodo = syncEntry.getContent(); Timber.v("%s: %s", action, vtodo); at.bitfire.ical4android.Task task = iCalendar.Companion.fromVtodo(vtodo); + if (task == null) { + continue; + } String remoteId = task.getUid(); CaldavTask caldavTask = caldavDao.getTaskByRemoteId(caldavCalendar.getUuid(), remoteId); switch (action) {