diff --git a/src/renderer/components/menu/menu.tsx b/src/renderer/components/menu/menu.tsx index 049d80c35c..f0d172b0d7 100644 --- a/src/renderer/components/menu/menu.tsx +++ b/src/renderer/components/menu/menu.tsx @@ -122,7 +122,10 @@ export class Menu extends React.Component { } refreshPosition = () => { - if (!this.props.usePortal || !this.opener) return; + if (!this.props.usePortal || !this.opener || !this.elem) { + return; + } + const { width, height } = this.opener.getBoundingClientRect(); let { left, top, bottom, right } = this.opener.getBoundingClientRect(); const withScroll = window.getComputedStyle(this.elem).position !== "fixed";