diff --git a/client/coral-framework/components/Popup.js b/client/coral-framework/components/Popup.js index b9393a36d..1fe3408ea 100644 --- a/client/coral-framework/components/Popup.js +++ b/client/coral-framework/components/Popup.js @@ -42,14 +42,14 @@ export default class Popup extends Component { this.onUnload(); const interval = setInterval(() => { - if (this.ref.onload === null) { + if (this.ref && this.ref.onload === null) { this.setCallbacks(); clearInterval(interval); } }, 50); this.detectCloseInterval = setInterval(() => { - if (this.ref.closed) { + if (!this.ref || this.ref.closed) { clearInterval(this.detectCloseInterval); this.onClose(); }