Fixed issue where port A motor position was not being reported because the port number was false-y

This commit is contained in:
Kevin Andersen committed 2019-07-30 10:20:34 -04:00
1 parent 4523597a04
commit 7d7ce2db13
1 file changed
+1 -1
+1 -1
View File
@@ -1935,7 +1935,7 @@ class Scratch3BoostBlocks {
log.warn('Asked for a motor position that doesnt exist!');
return false;
}
if (portID && this._peripheral.motor(portID)) {
if (portID !== null && this._peripheral.motor(portID)) {
let val = this._peripheral.motor(portID).position;
// Boost motor A position direction is reversed by design
// so we have to reverse the position here