add null-guard

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2019-12-02 10:06:58 +00:00
parent bfb5706b4a
commit e2733a27c4

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