1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-22 06:41:06 +02:00

Bangle.js: Prevent exception in case UART RX line is empty

This seems to fix the "no incoming call notification"-issue, see https://github.com/espruino/BangleApps/issues/976
This commit is contained in:
Marc Nause 2022-01-29 23:49:51 +01:00
parent bffbea6e38
commit e32dc8b48e

View File

@ -155,7 +155,7 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
if (">Uncaught ReferenceError: \"GB\" is not defined".equals(line))
GB.toast(getContext(), "Gadgetbridge plugin not installed on Bangle.js", Toast.LENGTH_LONG, GB.ERROR);
else if (line.charAt(0)=='{') {
else if (line.length() > 0 && line.charAt(0)=='{') {
// JSON - we hope!
try {
JSONObject json = new JSONObject(line);