Skip to content

Commit

Permalink
fix(google-maps): Added null check to addMarkers method
Browse files Browse the repository at this point in the history
  • Loading branch information
A1Jan committed May 5, 2023
1 parent 8a2e0ea commit 364d95a
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 364d95a

Please sign in to comment.