diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-18 00:40:33 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-18 00:40:33 -0600 |
commit | 9f42e2777fc2dc2b6231f559fd544247f9f2c334 (patch) | |
tree | 4a31e245bfd2bc61b2d8970f88079353bd3f4a29 | |
parent | e679a7d019391fce98a8a30458d09759733d60b1 (diff) | |
download | etbsa-trackermap-mobile-9f42e2777fc2dc2b6231f559fd544247f9f2c334.tar.gz etbsa-trackermap-mobile-9f42e2777fc2dc2b6231f559fd544247f9f2c334.tar.bz2 etbsa-trackermap-mobile-9f42e2777fc2dc2b6231f559fd544247f9f2c334.zip |
Fixed crash when selecting unit without position
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt index e64afd3..9718262 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt @@ -130,6 +130,9 @@ class UnitMapFragment : Fragment() { Log.d("UnitMapFragment", "Loading layer!") mapFragment.updateLayer(type) unitsViewModel.selectedUnit.value?.let { + if (it.position == null || it.position?.latitude == null || it.position?.longitude == null) { + return@let + } unitsViewModel.moveCamera( UnitsViewModel.Camera( point = Point2d( |