Handle missing option id when grouping cards

This commit is contained in:
Chen-I Lim 2020-10-27 12:08:12 -07:00
parent fa92e0fbfd
commit 48719f16ce

View file

@ -189,12 +189,16 @@ class MutableBoardTree implements BoardTree {
for (const optionId of optionIds) {
if (optionId) {
const option = groupByProperty.options.find(o => o.id === optionId)
if (option) {
const cards = this.cards.filter((o) => optionId === o.properties[groupByProperty.id])
const group: Group = {
option,
cards
}
groups.push(group)
} else {
Utils.logError(`groupCardsByOptions: Missing option with id: ${optionId}`)
}
} else {
// Empty group
const emptyGroupCards = this.cards.filter((o) => {