aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-18 00:40:33 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-18 00:40:33 -0600
commit9f42e2777fc2dc2b6231f559fd544247f9f2c334 (patch)
tree4a31e245bfd2bc61b2d8970f88079353bd3f4a29 /androidApp/src
parente679a7d019391fce98a8a30458d09759733d60b1 (diff)
downloadetbsa-trackermap-mobile-9f42e2777fc2dc2b6231f559fd544247f9f2c334.tar.gz
etbsa-trackermap-mobile-9f42e2777fc2dc2b6231f559fd544247f9f2c334.tar.bz2
etbsa-trackermap-mobile-9f42e2777fc2dc2b6231f559fd544247f9f2c334.zip
Fixed crash when selecting unit without position
Diffstat (limited to 'androidApp/src')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt3
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(