diff --git a/src/extensions/scratch3_microbit/index.js b/src/extensions/scratch3_microbit/index.js index 19451725a..16d8eebbd 100644 --- a/src/extensions/scratch3_microbit/index.js +++ b/src/extensions/scratch3_microbit/index.js @@ -250,6 +250,7 @@ class MicroBit { * @private */ _writeSessionData (command, message) { + if (!this.getPeripheralIsConnected()) return; const output = new Uint8Array(message.length + 1); output[0] = command; // attach command to beginning of message for (let i = 0; i < message.length; i++) {