Fix reverse geocoder error handling

pull/1376/head
Alex Baker 3 years ago
parent e2436414eb
commit 0b0177e608

@ -241,16 +241,16 @@ class LocationPickerActivity : InjectingAppCompatActivity(), Toolbar.OnMenuItemC
fun selectLocation() { fun selectLocation() {
val mapPosition = map.mapPosition ?: return val mapPosition = map.mapPosition ?: return
loadingIndicator.visibility = View.VISIBLE loadingIndicator.visibility = View.VISIBLE
try {
lifecycleScope.launch { lifecycleScope.launch {
try {
returnPlace(geocoder.reverseGeocode(mapPosition) ?: newPlace(mapPosition)) returnPlace(geocoder.reverseGeocode(mapPosition) ?: newPlace(mapPosition))
}
} catch (e: Exception) { } catch (e: Exception) {
loadingIndicator.visibility = View.GONE loadingIndicator.visibility = View.GONE
firebase.reportException(e) firebase.reportException(e)
toaster.longToast(e.message) toaster.longToast(e.message)
} }
} }
}
@OnClick(R.id.search) @OnClick(R.id.search)
fun searchPlace() { fun searchPlace() {

Loading…
Cancel
Save