diff --git a/src/matrix/room/Room.js b/src/matrix/room/Room.js index 03b2ed4b..0427799c 100644 --- a/src/matrix/room/Room.js +++ b/src/matrix/room/Room.js @@ -270,7 +270,7 @@ export class Room extends BaseRoom { _getPowerLevelsEvent(roomResponse) { const isPowerlevelEvent = event => event.type === POWERLEVELS_EVENT_TYPE; - const powerLevelEvent = roomResponse.timeline.events.find(isPowerlevelEvent) ?? roomResponse.state.events.find(isPowerlevelEvent); + const powerLevelEvent = roomResponse.timeline?.events.find(isPowerlevelEvent) ?? roomResponse.state?.events.find(isPowerlevelEvent); return powerLevelEvent; }