mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-13 03:07:32 +01:00
Xiaomi: Fix crash if device does not provide full stress and spo2 data
This commit is contained in:
parent
a62ff4eabb
commit
5ffed2aa62
@ -29,7 +29,7 @@ public class XiaomiSpo2SampleProvider extends AbstractSampleToTimeSampleProvider
|
||||
|
||||
@Override
|
||||
protected Spo2Sample convertSample(final XiaomiActivitySample sample) {
|
||||
if (sample.getSpo2() == 0) {
|
||||
if (sample.getSpo2() == null || sample.getSpo2() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ public class XiaomiStressSampleProvider extends AbstractSampleToTimeSampleProvid
|
||||
|
||||
@Override
|
||||
protected StressSample convertSample(final XiaomiActivitySample sample) {
|
||||
if (sample.getStress() == 0) {
|
||||
if (sample.getStress() == null || sample.getStress() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user