diff --git a/src/components/views/settings/tabs/room/BridgeSettingsTab.tsx b/src/components/views/settings/tabs/room/BridgeSettingsTab.tsx index 8638105cd9..3c74bd4c1a 100644 --- a/src/components/views/settings/tabs/room/BridgeSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/BridgeSettingsTab.tsx @@ -46,9 +46,10 @@ export default class BridgeSettingsTab extends React.Component { const client = MatrixClientPeg.get(); const roomState = client.getRoom(roomId).currentState; - return [].concat(...BRIDGE_EVENT_TYPES.map((typeName) => - Array.from(roomState.events.get(typeName).values()), - )); + return BRIDGE_EVENT_TYPES.map(typeName => { + const events = roomState.events.get(typeName); + return events ? Array.from(events.values()) : []; + }).flat(1); } render() {