From 3659973101d176e9cb4e6273b084d9dde722d83a Mon Sep 17 00:00:00 2001 From: Evelyn Eastmond Date: Tue, 21 Aug 2018 11:14:16 -0400 Subject: [PATCH] Fixing #1510: WeDo2 stop button gives console error if device not connected. --- src/extensions/scratch3_wedo2/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extensions/scratch3_wedo2/index.js b/src/extensions/scratch3_wedo2/index.js index 5b6f0d16f..03d0d0e61 100644 --- a/src/extensions/scratch3_wedo2/index.js +++ b/src/extensions/scratch3_wedo2/index.js @@ -657,6 +657,7 @@ class WeDo2 { * Stop the tone playing and motors on the WeDo 2.0 hub. */ _stopAll () { + if (!this.getPeripheralIsConnected()) return; this.stopTone(); this.stopAllMotors(); // this.stopLED();