mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-16 20:31:00 +02:00
Fix NPE when an error occurs during activity synchronization
(activityDataStruct is null after handleActivityFetchFinish()) Also remove superfluous log statement -- toasts are logged as well.
This commit is contained in:
parent
31599f2776
commit
8cd6bf09a4
@ -271,6 +271,7 @@ public class FetchActivityOperation extends AbstractBTLEOperation<MiBandSupport>
|
||||
getSupport().logMessageContent(value);
|
||||
}
|
||||
} else {
|
||||
GB.toast(getContext(), "error buffering activity data: remaining bytes: " + activityStruct.activityDataRemainingBytes + ", received: " + value.length, Toast.LENGTH_LONG, GB.ERROR);
|
||||
try {
|
||||
TransactionBuilder builder = performInitialized("send stop sync data");
|
||||
builder.write(getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT), new byte[]{MiBandService.COMMAND_STOP_SYNC_DATA});
|
||||
@ -279,10 +280,8 @@ public class FetchActivityOperation extends AbstractBTLEOperation<MiBandSupport>
|
||||
handleActivityFetchFinish();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("error stopping activity sync", e);
|
||||
}
|
||||
GB.toast(getContext(), "error buffering activity data: remaining bytes: " + activityStruct.activityDataRemainingBytes + ", received: " + value.length, Toast.LENGTH_LONG, GB.ERROR);
|
||||
LOG.error("error buffering activity data: remaining bytes: " + activityStruct.activityDataRemainingBytes + ", received: " + value.length);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user