fix: don't emit a possible null task

This commit is contained in:
kolaente 2022-09-29 18:05:25 +02:00
parent 3970d0fd31
commit 5f5ed410df
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 8 additions and 4 deletions

View File

@ -185,6 +185,10 @@ async function addTask() {
const taskRelationService = new TaskRelationService()
const relations = tasksToCreate.map(async t => {
const createdTask = createdTasks.find(ct => ct.title === t.title)
if (typeof createdTask === 'undefined') {
return
}
if (t.parent === null) {
emit('taskAdded', createdTask)
return