add null-guard

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2019-12-02 10:06:58 +00:00
parent bfb5706b4a
commit e2733a27c4
1 changed files with 1 additions and 1 deletions

View File

@ -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 = (