Add check for invalid symbol

This commit is contained in:
Kreg Hanning 2018-06-04 15:22:12 -04:00
parent 94464f0a52
commit 9055706333

View file

@ -560,6 +560,7 @@ class Scratch3MicroBitBlocks {
*/ */
displaySymbol (args) { displaySymbol (args) {
const hex = symbols2hex[args.SYMBOL]; const hex = symbols2hex[args.SYMBOL];
if (!hex) return;
const output = new Uint8Array(6); const output = new Uint8Array(6);
output[0] = BLECommand.CMD_DISPLAY_LED; output[0] = BLECommand.CMD_DISPLAY_LED;
output[1] = (hex >> 20) & 0x1F; output[1] = (hex >> 20) & 0x1F;