mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-25 11:26:47 +01:00
Xiaomi: fix NPE when no air quality is available
This commit is contained in:
parent
0e3e406320
commit
e2f60b38c9
@ -105,7 +105,7 @@ public class XiaomiWeatherService extends AbstractXiaomiService {
|
||||
)
|
||||
.setAQI(XiaomiProto.WeatherCurrentAQI.newBuilder()
|
||||
.setAQIText("Unknown") // some string like "Moderate"
|
||||
.setAQI(weatherSpec.airQuality.aqi)
|
||||
.setAQI(weatherSpec.airQuality != null && weatherSpec.airQuality.aqi >=0 ? weatherSpec.airQuality.aqi : 0)
|
||||
)
|
||||
.setWarning(XiaomiProto.WeatherCurrentWarning.newBuilder()
|
||||
.setCurrentWarning1(XiaomiProto.WeatherCurrentWarning1.newBuilder()
|
||||
|
Loading…
Reference in New Issue
Block a user