Fixing #1510: WeDo2 stop button gives console error if device not connected.

This commit is contained in:
Evelyn Eastmond 2018-08-21 11:14:16 -04:00
parent d1761466fc
commit 3659973101

View file

@ -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();