From a7f4fc22126800740389a313dd895670071da69f Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Thu, 12 Jul 2018 14:41:28 -0400 Subject: [PATCH] Microbit write bails out if not connected --- src/extensions/scratch3_microbit/index.js | 1 + 1 file changed, 1 insertion(+) 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++) {