Skip to content

Commit

Permalink
Merge pull request #8298 from RocketChat/hotfix/exception-on-room-not…
Browse files Browse the repository at this point in the history
…ification

[FIX] TypeError: Cannot read property 't' of undefined
  • Loading branch information
engelgabriel authored Sep 25, 2017
2 parents b16ff09 + 68dd526 commit dedbaba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/rocketchat-lib/server/functions/Notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit dedbaba

Please sign in to comment.