瀏覽代碼

Fixed Importing JSON exports fails.

Thanks to KeptnArgo and xet7 !

Fixes #3742
Lauri Ojansivu 4 年之前
父節點
當前提交
bd1de94312
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. 1 0
      models/cards.js
  2. 6 1
      models/trelloCreator.js

+ 1 - 0
models/cards.js

@@ -271,6 +271,7 @@ Cards.attachSchema(
       type: Number,
       decimal: true,
       defaultValue: 0,
+      optional: true,
     },
     subtaskSort: {
       /**

+ 6 - 1
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: [],