Skip to content

Commit

Permalink
When a manager tried to send a message in a live room, an error was b…
Browse files Browse the repository at this point in the history
…eing displayed because there is no subscription for the manager. (#10663)

[FIX] Livechat managers were not being able to send messages in some cases
  • Loading branch information
renatobecker authored and rodrigok committed May 18, 2018
1 parent 986cde3 commit 1070edf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/rocketchat-lib/client/MessageAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Meteor.startup(function() {
condition(message) {
const subscription = RocketChat.models.Subscriptions.findOne({rid: message.rid});

return Meteor.userId() !== message.u._id && !(subscription.ignored && subscription.ignored.indexOf(message.u._id) > -1);
return Meteor.userId() !== message.u._id && !(subscription && subscription.ignored && subscription.ignored.indexOf(message.u._id) > -1);
},
order: 20,
group: 'menu'
Expand All @@ -324,7 +324,7 @@ Meteor.startup(function() {
},
condition(message) {
const subscription = RocketChat.models.Subscriptions.findOne({rid: message.rid});
return Meteor.userId() !== message.u._id && subscription.ignored && subscription.ignored.indexOf(message.u._id) > -1;
return Meteor.userId() !== message.u._id && subscription && subscription.ignored && subscription.ignored.indexOf(message.u._id) > -1;
},
order: 20,
group: 'menu'
Expand Down

0 comments on commit 1070edf

Please sign in to comment.