From c9a6214256a0b3208d71db5a6e427c507e2b9ee0 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 29 Jan 2021 11:15:30 +0000 Subject: [PATCH] Tweak a few room ID checks --- src/components/structures/FilePanel.js | 2 +- src/components/views/rooms/WhoIsTypingTile.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/FilePanel.js b/src/components/structures/FilePanel.js index 4836b0f554..0e4df4621d 100644 --- a/src/components/structures/FilePanel.js +++ b/src/components/structures/FilePanel.js @@ -45,7 +45,7 @@ class FilePanel extends React.Component { }; onRoomTimeline = (ev, room, toStartOfTimeline, removed, data) => { - if (room.roomId !== this.props.roomId) return; + if (room?.roomId !== this.props?.roomId) return; if (toStartOfTimeline || !data || !data.liveEvent || ev.isRedacted()) return; if (ev.isBeingDecrypted()) { diff --git a/src/components/views/rooms/WhoIsTypingTile.js b/src/components/views/rooms/WhoIsTypingTile.js index c796142e78..905cbe6d09 100644 --- a/src/components/views/rooms/WhoIsTypingTile.js +++ b/src/components/views/rooms/WhoIsTypingTile.js @@ -81,7 +81,7 @@ export default class WhoIsTypingTile extends React.Component { }; onRoomTimeline = (event, room) => { - if (room && room.roomId === this.props.room.roomId) { + if (room?.roomId === this.props.room?.roomId) { const userId = event.getSender(); // remove user from usersTyping const usersTyping = this.state.usersTyping.filter((m) => m.userId !== userId);