mit-cml / appinventor-extensions

Source code of extensions published for MIT App Inventor
Apache License 2.0
86 stars 94 forks source link

Coerce strings to numbers in Write{Bytes,Shorts,Ints,Floats} #2

Closed ewpatton closed 5 years ago

ewpatton commented 6 years ago

If one passes an array of mixed values, including strings, to a Write function in the BLE extension, the extension does not attempt to coerce it to a number and throws an exception in an attempt to cast String to Integer. We should instead test whether the item is a String and then use the appropriate parse method to convert it to a number. If that fails, then we can signal an error.

ewpatton commented 5 years ago

Fixed via 8f6a850