Skip to content

Commit

Permalink
fix(google-maps): Added null check to addMarkers method (#1571)
Browse files Browse the repository at this point in the history
Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
  • Loading branch information
AE1NS and jcesarmobile committed May 9, 2023
1 parent c64920a commit 76e89a9
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,14 @@ class CapacitorGoogleMap(
val googleMapMarker = googleMap?.addMarker(markerOptions.await())
it.googleMapMarker = googleMapMarker

if (clusterManager != null) {
googleMapMarker?.remove()
}
if (googleMapMarker != null) {
if (clusterManager != null) {
googleMapMarker.remove()
}

markers[googleMapMarker!!.id] = it
markerIds.add(googleMapMarker.id)
markers[googleMapMarker.id] = it
markerIds.add(googleMapMarker.id)
}
}

if (clusterManager != null) {
Expand Down

0 comments on commit 76e89a9

Please sign in to comment.