From 0bce5889ffbc1f552441b363b50208a603817ad7 Mon Sep 17 00:00:00 2001 From: Langston Smith Date: Wed, 22 May 2019 13:13:49 -0700 Subject: [PATCH] added check for null latLng --- .../plugins/places/picker/ui/PlacePickerActivity.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin-places/src/main/java/com/mapbox/mapboxsdk/plugins/places/picker/ui/PlacePickerActivity.java b/plugin-places/src/main/java/com/mapbox/mapboxsdk/plugins/places/picker/ui/PlacePickerActivity.java index 43d99c632..315ca90b9 100644 --- a/plugin-places/src/main/java/com/mapbox/mapboxsdk/plugins/places/picker/ui/PlacePickerActivity.java +++ b/plugin-places/src/main/java/com/mapbox/mapboxsdk/plugins/places/picker/ui/PlacePickerActivity.java @@ -174,10 +174,12 @@ public void onChanged(@Nullable CarmenFeature carmenFeature) { private void makeReverseGeocodingSearch() { LatLng latLng = mapboxMap.getCameraPosition().target; - viewModel.reverseGeocode( - Point.fromLngLat(latLng.getLongitude(), latLng.getLatitude()), - accessToken, options - ); + if (latLng != null) { + viewModel.reverseGeocode( + Point.fromLngLat(latLng.getLongitude(), latLng.getLatitude()), + accessToken, options + ); + } } private void addChosenLocationButton() {