diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index 3095981ccb..8214ffc71b 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -382,7 +382,7 @@ module.exports = createReactClass({ } let contextMenu; - if (this.state.menuDisplayed) { + if (this.state.menuDisplayed && this._contextMenuButton.current) { const elementRect = this._contextMenuButton.current.getBoundingClientRect(); const RoomTileContextMenu = sdk.getComponent('context_menus.RoomTileContextMenu'); contextMenu = (