diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiSampleProvider.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiSampleProvider.java index eea8be467..22a375901 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiSampleProvider.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiSampleProvider.java @@ -366,8 +366,8 @@ public class HuaweiSampleProvider extends AbstractSampleProvider processedSamples.size()) - return; + if (currentIndex >= processedSamples.size()) + return; // We cannot add the data to any samples, so we might as well return } // Update data @@ -452,8 +452,8 @@ public class HuaweiSampleProvider extends AbstractSampleProvider processedSamples.size()) - return; + if (currentIndex >= processedSamples.size()) + return; // We cannot add the data to any samples, so we might as well return } if (workoutSamples.get(i).getHeartRate() != ActivitySample.NOT_MEASURED)