mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-06-05 21:49:48 +02:00
Made Mi Band activity fetching not crash the application
This commit is contained in:
@@ -153,6 +153,14 @@ public class FetchActivityOperation extends AbstractMiBand1Operation {
|
||||
|
||||
public FetchActivityOperation(MiBandSupport support) {
|
||||
super(support);
|
||||
if (support == null) {
|
||||
LOG.error("MiBandSupport was null");
|
||||
return;
|
||||
}
|
||||
if (support.getDeviceInfo() == null) {
|
||||
LOG.error("MiBandSupport getDeviceInfo returned null");
|
||||
return;
|
||||
}
|
||||
hasExtendedActivityData = support.getDeviceInfo().supportsHeartrate();
|
||||
hasPacketCounter = support.getDeviceInfo().getProfileVersion() >= 0x02000700;
|
||||
//temporary buffer, size is a multiple of 60 because we want to store complete minutes (1 minute = 3 or 4 bytes)
|
||||
|
Reference in New Issue
Block a user