From db2ea0a039ba1002099a73e05e52df4da5572855 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Thu, 21 Mar 2024 22:47:03 -0500 Subject: [PATCH] Fix import crash on missing remoteId --- app/src/main/java/org/tasks/backup/TasksJsonImporter.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/tasks/backup/TasksJsonImporter.kt b/app/src/main/java/org/tasks/backup/TasksJsonImporter.kt index 97506c5d2..59d810dae 100644 --- a/app/src/main/java/org/tasks/backup/TasksJsonImporter.kt +++ b/app/src/main/java/org/tasks/backup/TasksJsonImporter.kt @@ -179,7 +179,9 @@ class TasksJsonImporter @Inject constructor( ?.filter { it.deleted == 0L } ?.any { val existing = if (it.`object`.isNullOrBlank()) { - caldavDao.getTaskByRemoteId(it.calendar!!, it.remoteId!!) + it.remoteId?.let { remoteId -> + caldavDao.getTaskByRemoteId(it.calendar!!, remoteId) + } } else { caldavDao.getTask(it.calendar!!, it.`object`!!) }