fix: `getMslAltitudeMeters` call when MSL altitude is not available

renovate/osmdroid_version
andrekir 2024-06-16 07:55:22 -03:00
rodzic d4f4e4f14a
commit e5396524fb
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -181,7 +181,9 @@ class MeshService : Service(), Logging {
position {
latitudeI = Position.degI(location.latitude)
longitudeI = Position.degI(location.longitude)
altitude = LocationCompat.getMslAltitudeMeters(location).toInt()
if (LocationCompat.hasMslAltitude(location)) {
altitude = LocationCompat.getMslAltitudeMeters(location).toInt()
}
altitudeHae = location.altitude.toInt()
time = (location.time / 1000).toInt()
groundSpeed = location.speed.toInt()