From 27ee16ea1ed81909bac571666ae2b1f9f3c4e911 Mon Sep 17 00:00:00 2001 From: Ben0it-T Date: Sat, 25 Dec 2021 13:34:10 +0100 Subject: [PATCH 1/2] Fix getLabels exception --- client/components/lists/listBody.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index bb03d72cd..18b2c85a4 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -277,9 +277,12 @@ BlazeComponent.extendComponent({ getLabels() { const currentBoardId = Session.get('currentBoard'); - return Boards.findOne(currentBoardId).labels.filter(label => { - return this.labels.get().indexOf(label._id) > -1; - }); + if (Boards.findOne(currentBoardId).labels) { + return Boards.findOne(currentBoardId).labels.filter(label => { + return this.labels.get().indexOf(label._id) > -1; + }); + } + return false; }, pressKey(evt) { From 8aa816149f9fb57434a59653956e8284d7a1c699 Mon Sep 17 00:00:00 2001 From: Ben0it-T Date: Sat, 25 Dec 2021 18:30:41 +0100 Subject: [PATCH 2/2] Fix Labels search (Uncaught TypeError: t.name is undefined) --- client/components/lists/listBody.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 18b2c85a4..7ca6f157e 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -363,6 +363,9 @@ BlazeComponent.extendComponent({ const currentBoard = Boards.findOne(Session.get('currentBoard')); callback( $.map(currentBoard.labels, label => { + if (label.name == undefined) { + label.name = ""; + } if ( label.name.indexOf(term) > -1 || label.color.indexOf(term) > -1