Merge pull request #8298 from RocketChat/hotfix/exception-on-room-notification

[FIX] TypeError: Cannot read property 't' of undefined
pull/8461/head
Gabriel Engel 8 years ago committed by Rodrigo Nascimento
parent 3e72e0c2d4
commit ab6339399d
No known key found for this signature in database
GPG Key ID: CFCE33B7B01AC335
  1. 4
      packages/rocketchat-lib/server/functions/Notifications.js

@ -36,6 +36,10 @@ RocketChat.Notifications = new class {
}
});
const room = RocketChat.models.Rooms.findOneById(roomId);
if (!room) {
console.warn(`Invalid streamRoom eventName: "${ eventName }"`);
return false;
}
if (room.t === 'l' && room.v._id === user._id) {
return true;
}

Loading…
Cancel
Save