From 243fc52a96e1089aad89ff6b642c6605d8f71afd Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Mon, 21 Mar 2022 08:43:46 -0700 Subject: [PATCH] fix: opening/closing the mutators (#6000) --- core/mutator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/mutator.js b/core/mutator.js index fc9391d3684..08b36533e2b 100644 --- a/core/mutator.js +++ b/core/mutator.js @@ -366,8 +366,10 @@ class Mutator extends Icon { if (this.block_.saveConnections) { const thisRootBlock = this.rootBlock_; this.block_.saveConnections(thisRootBlock); - this.sourceListener_ = function() { - this.block_.saveConnections(thisRootBlock); + this.sourceListener_ = () => { + if (this.block_) { + this.block_.saveConnections(thisRootBlock); + } }; this.block_.workspace.addChangeListener(this.sourceListener_); }