Don't crash if parent not found

pull/1074/head
Alex Baker 4 years ago
parent 4234c6e494
commit c06f5958b4

@ -159,7 +159,7 @@ class TaskMover @Inject constructor(
for (child in taskDao.fetchChildren(task.id)) { for (child in taskDao.fetchChildren(task.id)) {
val newTask = CaldavTask(child.id, listId) val newTask = CaldavTask(child.id, listId)
val parent = child.parent val parent = child.parent
newTask.remoteParent = (if (parent == id) root else tasks[parent])!!.remoteId newTask.remoteParent = (if (parent == id) root else tasks[parent])?.remoteId
tasks[child.id] = newTask tasks[child.id] = newTask
} }
caldavDao.insert(task, root, preferences.addTasksToTop()) caldavDao.insert(task, root, preferences.addTasksToTop())

Loading…
Cancel
Save