Don't crash on missing vtodo value

pull/2906/head
Alex Baker 3 weeks ago
parent 4a2fb13d10
commit 2fc6833854

@ -48,7 +48,7 @@ class BackupContainer(
val comments: List<UserActivity>,
val attachments: List<Attachment>?,
val caldavTasks: List<CaldavTask>?,
val vtodo: String?,
val vtodo: String? = null,
val google: List<GoogleTask> = emptyList(),
) {
val locations: List<LegacyLocation> = emptyList()

@ -125,15 +125,16 @@ class TasksJsonExporter @Inject constructor(
val caldavTasks = caldavDao.getTasks(taskId)
taskBackups.add(
TaskBackup(
task,
alarmDao.getAlarms(taskId),
locationDao.getGeofencesForTask(taskId),
tagDao.getTagsForTask(taskId),
userActivityDao.getComments(taskId),
taskAttachmentDao.getAttachmentsForTask(taskId),
caldavTasks,
vtodoCache.getVtodo( caldavTasks.firstOrNull { !it.isDeleted() })
))
task = task,
alarms = alarmDao.getAlarms(taskId),
geofences = locationDao.getGeofencesForTask(taskId),
tags = tagDao.getTagsForTask(taskId),
comments = userActivityDao.getComments(taskId),
attachments = taskAttachmentDao.getAttachmentsForTask(taskId),
caldavTasks = caldavTasks,
vtodo = vtodoCache.getVtodo(caldavTasks.firstOrNull { !it.isDeleted() })
)
)
}
val data = JsonObject(
mapOf(

Loading…
Cancel
Save