Fixed UninitPropertyAccessException crash in MapFragment

This commit is contained in:
Arty Bishop committed 2022-03-13 20:38:06 +00:00
1 parent de2978138a
commit 47a83a8bfe
1 file changed
+4 -4
@@ -46,7 +46,7 @@ class MapViewModel @Inject constructor(
private var allSatellites = listOf<Satellite>()
private var dataUpdateJob: Job? = null
private var dataUpdateRate = 1000L
private lateinit var selectedSatellite: Satellite
private var selectedSatellite: Satellite? = null
val stationPos = liveData {
val osmLat = clipLat(stationPosition.lat)
@@ -102,12 +102,12 @@ class MapViewModel @Inject constructor(
dataUpdateJob?.cancelAndJoin()
dataUpdateJob = launch {
val dateNow = Date()
getSatTrack(selectedSatellite, stationPosition, dateNow)
getSatTrack(satellite, stationPosition, dateNow)
while (isActive) {
dateNow.time = System.currentTimeMillis()
getPositions(allSatellites, stationPosition, dateNow)
getSatFootprint(selectedSatellite, stationPosition, dateNow)
getSatData(selectedSatellite, stationPosition, dateNow)
getSatFootprint(satellite, stationPosition, dateNow)
getSatData(satellite, stationPosition, dateNow)
delay(updateFreq)
}
}