diff --git a/src/editor/Editor.jsx b/src/editor/Editor.jsx index c4a0e13..9c92edd 100644 --- a/src/editor/Editor.jsx +++ b/src/editor/Editor.jsx @@ -67,8 +67,10 @@ export default class Editor extends Component { // This makes sure the editor is repositioned if the widgets change const observer = new MutationObserver(debounce(() => { - this.removeObserver && this.removeObserver(); - this.removeObserver = this.initResizeObserver(); + if (this.element.current) { + this.removeObserver && this.removeObserver(); + this.removeObserver = this.initResizeObserver(); + } })); observer.observe(this.element.current, { childList: true, subtree: true });