From a0d0c2cb1f6b25ed3c3a237ab1e9902b79e1c484 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 19 Jul 2022 17:13:22 +0200 Subject: [PATCH] fix(kanban): error when moving a task to an empty bucket --- src/views/list/ListKanban.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/views/list/ListKanban.vue b/src/views/list/ListKanban.vue index 57c682b3..33010dd6 100644 --- a/src/views/list/ListKanban.vue +++ b/src/views/list/ListKanban.vue @@ -436,8 +436,7 @@ export default defineComponent({ await this.$store.dispatch('tasks/update', newTask) // Make sure the first and second task don't both get position 0 assigned - if(newTaskIndex === 0 && taskAfter.kanbanPosition === 0) { - console.log('first', taskAfter.id, taskAfter.kanbanPosition) + if(newTaskIndex === 0 && taskAfter !== null && taskAfter.kanbanPosition === 0) { const taskAfterAfter = newBucket.tasks[newTaskIndex + 2] ?? null const newTaskAfter = cloneDeep(taskAfter) // cloning the task to avoid vuex store mutations newTaskAfter.bucketId = newBucket.id