From 61d2c43e04c831ad06745478613aaba02648652b Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Thu, 7 Oct 2021 21:34:31 +0200 Subject: [PATCH] Bugfix --- src/editor/Editor.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 });