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 | 608185b36f6141fba750756472689af3d4d6ab83 (patch) | |
tree | 4a31e245bfd2bc61b2d8970f88079353bd3f4a29 | |
parent | eb22658cf7c314579bc62a786cdf6fa576c633a8 (diff) | |
download | etbsa-trackermap-mobile-608185b36f6141fba750756472689af3d4d6ab83.tar.gz etbsa-trackermap-mobile-608185b36f6141fba750756472689af3d4d6ab83.tar.bz2 etbsa-trackermap-mobile-608185b36f6141fba750756472689af3d4d6ab83.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( |