Skip to content

Commit

Permalink
Bangle.js: Avoid crash when empty json comes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlich committed Sep 29, 2024
1 parent faee8ea commit 459269e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion daemon/src/services/uartservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void UARTService::handleRx(const QString &json)

if (json.contains( "Uncaught ReferenceError: \"gb\" is not defined")) {
emit message("Gadgetbridge plugin not installed on Bangle.js");
} else if (json.at(0)=='{') {
} else if ((json.length() > 0) && (json.at(0)=='{')) {
// JSON - we hope!
QJsonObject obj = ObjectFromString(json);
emit jsonRx(obj);
Expand Down

0 comments on commit 459269e

Please sign in to comment.