mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Microbit write bails out if not connected
This commit is contained in:
parent
0c21f739ec
commit
a7f4fc2212
1 changed files with 1 additions and 0 deletions
|
@ -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++) {
|
||||
|
|
Loading…
Reference in a new issue