diff --git a/src/blocks/scratch3_sound.js b/src/blocks/scratch3_sound.js index 48d25dde9..1d7cfa239 100644 --- a/src/blocks/scratch3_sound.js +++ b/src/blocks/scratch3_sound.js @@ -18,7 +18,9 @@ class Scratch3SoundBlocks { } this._onTargetCreated = this._onTargetCreated.bind(this); - runtime.on('targetWasCreated', this._onTargetCreated); + if (this.runtime) { + runtime.on('targetWasCreated', this._onTargetCreated); + } } /**