From dc81496c3bcd9c0aa3cb1819c1e14daf822874c5 Mon Sep 17 00:00:00 2001 From: dangwynne Date: Fri, 29 Jan 2021 11:31:21 +0000 Subject: [PATCH] add optional chaining operator --- src/components/views/rooms/RoomTile.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/RoomTile.tsx b/src/components/views/rooms/RoomTile.tsx index 631abeed10..835447dc18 100644 --- a/src/components/views/rooms/RoomTile.tsx +++ b/src/components/views/rooms/RoomTile.tsx @@ -155,8 +155,8 @@ export default class RoomTile extends React.PureComponent { CommunityPrototypeStore.getUpdateEventName(this.props.room?.roomId), this.onCommunityUpdate, ); - prevProps.room.off("Room.name", this.onRoomNameUpdate); - this.props.room.on("Room.name", this.onRoomNameUpdate); + prevProps.room?.off("Room.name", this.onRoomNameUpdate); + this.props.room?.on("Room.name", this.onRoomNameUpdate); } }