summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Renshaw <david@sandstorm.io>2016-11-21 22:49:53 -0500
committerDavid Renshaw <david@sandstorm.io>2016-11-21 22:49:53 -0500
commit7b5d08afd143baa835ecc40eab115d353e5d87dd (patch)
treefd3d2c406fa0655aa474ab9b3c6600ec2dd8a774
parent1ad41072010fb59fdbace80a0aa049634074dac1 (diff)
downloadwekan-7b5d08afd143baa835ecc40eab115d353e5d87dd.tar.gz
wekan-7b5d08afd143baa835ecc40eab115d353e5d87dd.tar.bz2
wekan-7b5d08afd143baa835ecc40eab115d353e5d87dd.zip
fix bug where old users could see broken presence indicators on new users
-rw-r--r--server/publications/boards.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/server/publications/boards.js b/server/publications/boards.js
index cd3ef238..fd352552 100644
--- a/server/publications/boards.js
+++ b/server/publications/boards.js
@@ -99,20 +99,21 @@ Meteor.publishRelations('board', function(boardId) {
this.cursor(Attachments.find({ cardId }));
});
- // Board members. This publication also includes former board members that
- // aren't members anymore but may have some activities attached to them in
- // the history.
- //
- this.cursor(Users.find({
- _id: { $in: _.pluck(board.members, 'userId') },
- }, { fields: {
- 'username': 1,
- 'profile.fullname': 1,
- 'profile.avatarUrl': 1,
- }}), function(userId) {
- // Presence indicators
- this.cursor(presences.find({ userId }));
- });
+ if (board.members) {
+ // Board members. This publication also includes former board members that
+ // aren't members anymore but may have some activities attached to them in
+ // the history.
+ this.cursor(Users.find({
+ _id: { $in: _.pluck(board.members, 'userId') },
+ }, { fields: {
+ 'username': 1,
+ 'profile.fullname': 1,
+ 'profile.avatarUrl': 1,
+ }}), function(userId) {
+ // Presence indicators
+ this.cursor(presences.find({ userId }));
+ });
+ }
});
return this.ready();