From 90b1f49b44309ac805c8ff3e3690797c24a6b905 Mon Sep 17 00:00:00 2001 From: peter <16809252+percula@users.noreply.github.com> Date: Mon, 23 Mar 2020 10:00:10 -0400 Subject: [PATCH] fix: Catch null latLng --- .../pingplacepicker/ui/PlacePickerActivity.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/library/src/main/java/com/rtchagas/pingplacepicker/ui/PlacePickerActivity.kt b/library/src/main/java/com/rtchagas/pingplacepicker/ui/PlacePickerActivity.kt index 2abce4b..5006743 100644 --- a/library/src/main/java/com/rtchagas/pingplacepicker/ui/PlacePickerActivity.kt +++ b/library/src/main/java/com/rtchagas/pingplacepicker/ui/PlacePickerActivity.kt @@ -253,14 +253,15 @@ class PlacePickerActivity : AppCompatActivity(), PingKoinComponent, clear() for (place in places) { + place.latLng?.let { + val marker: Marker = addMarker( + MarkerOptions() + .position(it) + .icon(getPlaceMarkerBitmap(place)) + ) - val marker: Marker = addMarker( - MarkerOptions() - .position(place.latLng!!) - .icon(getPlaceMarkerBitmap(place)) - ) - - marker.tag = place + marker.tag = place + } } } }