mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01: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:
parent
376956bbe9
commit
0f83346d65
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user