summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xclient/components/main/editor.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/client/components/main/editor.js b/client/components/main/editor.js
index 20ece562..8ea73793 100755
--- a/client/components/main/editor.js
+++ b/client/components/main/editor.js
@@ -9,10 +9,12 @@ Template.editor.onRendered(() => {
match: /\B@([\w.]*)$/,
search(term, callback) {
const currentBoard = Boards.findOne(Session.get('currentBoard'));
- callback(currentBoard.activeMembers().map((member) => {
- const username = Users.findOne(member.userId).username;
- return username.includes(term) ? username : null;
- }).filter(Boolean));
+ if (currentBoard) {
+ callback(currentBoard.activeMembers().map((member) => {
+ const username = Users.findOne(member.userId).username;
+ return username.includes(term) ? username : null;
+ }).filter(Boolean));
+ }
},
template(value) {
return value;
@@ -37,6 +39,9 @@ const at = HTML.CharRef({html: '@', str: '@'});
Blaze.Template.registerHelper('mentions', new Template('mentions', function() {
const view = this;
const currentBoard = Boards.findOne(Session.get('currentBoard'));
+ if (!currentBoard) {
+ return HTML.Raw("");
+ }
const knowedUsers = currentBoard.members.map((member) => {
const u = Users.findOne(member.userId);
if(u){