1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-02 09:46:24 +02:00

Xiaomi: check if binary parser result is null

The activity parser may return null pointers in case the version
of the data structure is not supported. Not checking for null here may
result in the activity fetching task may never complete and cause
further communication with the device to grind to a halt.
This commit is contained in:
MrYoranimo 2023-12-04 22:03:59 +01:00
parent 376956bbe9
commit 0f83346d65

View File

@ -60,6 +60,11 @@ public class WorkoutSummaryParser extends XiaomiActivityParser implements Activi
return false;
}
// parseBinaryData may return null in case the version is not supported
if (summary == null) {
return false;
}
summary.setSummaryData(null); // remove json before saving to database
try (DBHandler dbHandler = GBApplication.acquireDB()) {