mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-06-05 21:49:48 +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:
@@ -155,7 +155,7 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
|
|||||||
|
|
||||||
if (">Uncaught ReferenceError: \"GB\" is not defined".equals(line))
|
if (">Uncaught ReferenceError: \"GB\" is not defined".equals(line))
|
||||||
GB.toast(getContext(), "Gadgetbridge plugin not installed on Bangle.js", Toast.LENGTH_LONG, GB.ERROR);
|
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!
|
// JSON - we hope!
|
||||||
try {
|
try {
|
||||||
JSONObject json = new JSONObject(line);
|
JSONObject json = new JSONObject(line);
|
||||||
|
Reference in New Issue
Block a user