From d3f1754dfd9fceff5df45b4f8cdaf9e606214dbc Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Mon, 17 May 2021 12:24:41 -0400 Subject: [PATCH] Fix crash on opening notification panel The check for pending edits needed a null guard, since the notification panel uses MessagePanel but is not associated with a specific room. Signed-off-by: Robin Townsend --- src/components/structures/MessagePanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 73a2a3c4b6..d1071a9e19 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -473,7 +473,7 @@ export default class MessagePanel extends React.Component { } get _roomHasPendingEdit() { - return localStorage.getItem(`mx_edit_room_${this.props.room.roomId}`); + return this.props.room && localStorage.getItem(`mx_edit_room_${this.props.room.roomId}`); } _getEventTiles() {