diff options
author | Jonathan Baird <jonathan@smithbox.com> | 2020-04-11 17:28:15 -0600 |
---|---|---|
committer | Jonathan Baird <jonathan@smithbox.com> | 2020-04-11 17:28:15 -0600 |
commit | 269382869e20a9b172dfa5f56f4d06a7722993ef (patch) | |
tree | 00eb292513bc408b2dfc060db1e5334735d6e434 /models | |
parent | 58ce859368f751c30f264890cc75298dd792834f (diff) | |
download | wekan-269382869e20a9b172dfa5f56f4d06a7722993ef.tar.gz wekan-269382869e20a9b172dfa5f56f4d06a7722993ef.tar.bz2 wekan-269382869e20a9b172dfa5f56f4d06a7722993ef.zip |
fix error in notifications cleanup cron
Diffstat (limited to 'models')
-rw-r--r-- | models/users.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/models/users.js b/models/users.js index b1f3e26c..3700d1c8 100644 --- a/models/users.js +++ b/models/users.js @@ -815,7 +815,7 @@ if (Meteor.isServer) { user.addInvite(boardId); //Check if there is a subtasks board - if (board.subtasksDefaultBoardId){ + if (board.subtasksDefaultBoardId) { const subBoard = Boards.findOne(board.subtasksDefaultBoardId); //If there is, also add user to that board if (subBoard) { @@ -823,7 +823,7 @@ if (Meteor.isServer) { user.addInvite(subBoard._id); } } - + try { const params = { user: user.username, @@ -952,6 +952,7 @@ const addCronJob = _.debounce( schedule: parser => parser.text('every 1 days'), job: () => { for (const user of Users.find()) { + if (!user.profile || !user.profile.notifications) continue; for (const notification of user.profile.notifications) { if (notification.read) { const removeDate = new Date(notification.read); |