You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Don't blow up when rooms have no timelines
This commit is contained in:
@@ -450,6 +450,10 @@ class RoomListStore extends Store {
|
||||
}
|
||||
|
||||
_tsOfNewestEvent(room) {
|
||||
// Apparently we can have rooms without timelines, at least under testing
|
||||
// environments. Just return MAX_INT when this happens.
|
||||
if (!room.timeline) return Number.MAX_SAFE_INTEGER;
|
||||
|
||||
for (let i = room.timeline.length - 1; i >= 0; --i) {
|
||||
const ev = room.timeline[i];
|
||||
if (this._eventTriggersRecentReorder(ev)) {
|
||||
|
||||
Reference in New Issue
Block a user