From bd1de94312e428e56d6cf5f343098475573cba0b Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 29 May 2021 00:52:36 +0300 Subject: [PATCH] Fixed Importing JSON exports fails. Thanks to KeptnArgo and xet7 ! Fixes #3742 --- models/cards.js | 1 + models/trelloCreator.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/models/cards.js b/models/cards.js index a674efe31..b72293cfa 100644 --- a/models/cards.js +++ b/models/cards.js @@ -271,6 +271,7 @@ Cards.attachSchema( type: Number, decimal: true, defaultValue: 0, + optional: true, }, subtaskSort: { /** diff --git a/models/trelloCreator.js b/models/trelloCreator.js index d7e861a75..2054cf28b 100644 --- a/models/trelloCreator.js +++ b/models/trelloCreator.js @@ -157,9 +157,14 @@ export class TrelloCreator { // You must call parseActions before calling this one. createBoardAndLabels(trelloBoard) { + let color = 'blue'; + if (this.getColor(trelloBoard.prefs.background) !== undefined) { + color = this.getColor(trelloBoard.prefs.background); + } + const boardToCreate = { archived: trelloBoard.closed, - color: this.getColor(trelloBoard.prefs.background), + color: color, // very old boards won't have a creation activity so no creation date createdAt: this._now(this.createdAt.board), labels: [],