mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -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
|
* @private
|
||||||
*/
|
*/
|
||||||
_writeSessionData (command, message) {
|
_writeSessionData (command, message) {
|
||||||
|
if (!this.getPeripheralIsConnected()) return;
|
||||||
const output = new Uint8Array(message.length + 1);
|
const output = new Uint8Array(message.length + 1);
|
||||||
output[0] = command; // attach command to beginning of message
|
output[0] = command; // attach command to beginning of message
|
||||||
for (let i = 0; i < message.length; i++) {
|
for (let i = 0; i < message.length; i++) {
|
||||||
|
|
Loading…
Reference in a new issue