mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-27 18:17:33 +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
|
@Override
|
||||||
protected Spo2Sample convertSample(final XiaomiActivitySample sample) {
|
protected Spo2Sample convertSample(final XiaomiActivitySample sample) {
|
||||||
if (sample.getSpo2() == 0) {
|
if (sample.getSpo2() == null || sample.getSpo2() == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ public class XiaomiStressSampleProvider extends AbstractSampleToTimeSampleProvid
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected StressSample convertSample(final XiaomiActivitySample sample) {
|
protected StressSample convertSample(final XiaomiActivitySample sample) {
|
||||||
if (sample.getStress() == 0) {
|
if (sample.getStress() == null || sample.getStress() == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user