diff --git a/app/ui-cached-collection/client/models/CachedCollection.js b/app/ui-cached-collection/client/models/CachedCollection.js index 1639b77d0053e..eec9930c90d5a 100644 --- a/app/ui-cached-collection/client/models/CachedCollection.js +++ b/app/ui-cached-collection/client/models/CachedCollection.js @@ -276,7 +276,9 @@ export class CachedCollection extends Emitter { let room; if (this.eventName === 'subscriptions-changed') { room = ChatRoom.findOne(record.rid); - this.removeRoomFromCacheWhenUserLeaves(room._id, ChatRoom, CachedChatRoom); + if (room) { + this.removeRoomFromCacheWhenUserLeaves(room._id, ChatRoom, CachedChatRoom); + } } else { room = this.collection.findOne({ _id: record._id,