From c06b781837c66174be41f40c967fbfcbcc35495e Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 5 Sep 2022 15:49:21 +0200 Subject: [PATCH] fix: don't try to set the bucket of a task when it was moved to a new list --- src/store/modules/kanban.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/store/modules/kanban.ts b/src/store/modules/kanban.ts index 0f302eb0b..df09d46cf 100644 --- a/src/store/modules/kanban.ts +++ b/src/store/modules/kanban.ts @@ -30,6 +30,9 @@ function getTaskIndicesById(state: KanbanState, taskId: ITask['id']) { const addTaskToBucketAndSort = (state: KanbanState, task: ITask) => { const bucketIndex = findIndexById(state.buckets, task.bucketId) + if(typeof state.buckets[bucketIndex] === 'undefined') { + return + } state.buckets[bucketIndex].tasks.push(task) state.buckets[bucketIndex].tasks.sort((a, b) => a.kanbanPosition > b.kanbanPosition ? 1 : -1) }