summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-03-12 22:57:38 +0200
committerGitHub <noreply@github.com>2019-03-12 22:57:38 +0200
commit1158cd42ccf1b95d5bc7b00ed349fdfb208f2608 (patch)
treec2f28199ae102b01ce43ddaa8f2b3df43d3529cc
parentcf7d740004d5b7511a7c0fc434437cba4390f824 (diff)
parent0e2b7458d7ac98e312c1a231b9dfe7d0965ea986 (diff)
downloadwekan-1158cd42ccf1b95d5bc7b00ed349fdfb208f2608.tar.gz
wekan-1158cd42ccf1b95d5bc7b00ed349fdfb208f2608.tar.bz2
wekan-1158cd42ccf1b95d5bc7b00ed349fdfb208f2608.zip
Merge pull request #2253 from justinr1234/devel
Fix watchers undefined #2252
-rw-r--r--models/activities.js24
1 files changed, 15 insertions, 9 deletions
diff --git a/models/activities.js b/models/activities.js
index 84c45856..1e97895d 100644
--- a/models/activities.js
+++ b/models/activities.js
@@ -113,9 +113,11 @@ if (Meteor.isServer) {
}
if (activity.oldBoardId) {
const oldBoard = activity.oldBoard();
- watchers = _.union(watchers, oldBoard.watchers || []);
- params.oldBoard = oldBoard.title;
- params.oldBoardId = activity.oldBoardId;
+ if (oldBoard) {
+ watchers = _.union(watchers, oldBoard.watchers || []);
+ params.oldBoard = oldBoard.title;
+ params.oldBoardId = activity.oldBoardId;
+ }
}
if (activity.memberId) {
participants = _.union(participants, [activity.memberId]);
@@ -129,15 +131,19 @@ if (Meteor.isServer) {
}
if (activity.oldListId) {
const oldList = activity.oldList();
- watchers = _.union(watchers, oldList.watchers || []);
- params.oldList = oldList.title;
- params.oldListId = activity.oldListId;
+ if (oldList) {
+ watchers = _.union(watchers, oldList.watchers || []);
+ params.oldList = oldList.title;
+ params.oldListId = activity.oldListId;
+ }
}
if (activity.oldSwimlaneId) {
const oldSwimlane = activity.oldSwimlane();
- watchers = _.union(watchers, oldSwimlane.watchers || []);
- params.oldSwimlane = oldSwimlane.title;
- params.oldSwimlaneId = activity.oldSwimlaneId;
+ if (oldSwimlane) {
+ watchers = _.union(watchers, oldSwimlane.watchers || []);
+ params.oldSwimlane = oldSwimlane.title;
+ params.oldSwimlaneId = activity.oldSwimlaneId;
+ }
}
if (activity.cardId) {
const card = activity.card();