mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Check for room
in all Room.timeline*
handlers
All `Room.timeline*` handlers must currently test for `room` first if they expect it to exist. It is emitted not only for rooms, but also for timeline sets without rooms, such as for notifications. Almost all such handlers were correctly testing as needed, but it was missing from `RoomBreadcrumbs`. While that's quite confusing, we can start by testing for `room` when we expect to have one. Fixes https://github.com/vector-im/riot-web/issues/9630
This commit is contained in:
parent
33bb9e2af6
commit
c37ecb7a91
1 changed files with 1 additions and 0 deletions
|
@ -117,6 +117,7 @@ export default class RoomBreadcrumbs extends React.Component {
|
|||
};
|
||||
|
||||
onRoomTimeline = (event, room) => {
|
||||
if (!room) return; // Can be null for the notification timeline, etc.
|
||||
if (this.state.rooms.map(r => r.room.roomId).includes(room.roomId)) {
|
||||
this._calculateRoomBadges(room);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue