mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-12-24 03:35:50 +01:00
Mapbox: Fix crash when using Marker.getTag() when tag was not set yet
This commit is contained in:
parent
d42d8a81a4
commit
3ef330ad7b
@ -272,7 +272,7 @@ class GoogleMapImpl(private val context: Context, var options: GoogleMapOptions)
|
||||
return fill
|
||||
}
|
||||
|
||||
override fun addMarker(options: MarkerOptions): IMarkerDelegate? {
|
||||
override fun addMarker(options: MarkerOptions): IMarkerDelegate {
|
||||
val marker = MarkerImpl(this, "m${markerId++}", options)
|
||||
synchronized(this) {
|
||||
val symbolManager = symbolManager
|
||||
|
@ -18,6 +18,7 @@ package org.microg.gms.maps.mapbox.model
|
||||
|
||||
import android.util.Log
|
||||
import com.google.android.gms.dynamic.IObjectWrapper
|
||||
import com.google.android.gms.dynamic.ObjectWrapper
|
||||
import com.google.android.gms.maps.model.LatLng
|
||||
import com.google.android.gms.maps.model.MarkerOptions
|
||||
import com.google.android.gms.maps.model.internal.IMarkerDelegate
|
||||
@ -199,9 +200,9 @@ class MarkerImpl(private val map: GoogleMapImpl, private val id: String, options
|
||||
this.tag = obj
|
||||
}
|
||||
|
||||
override fun getTag(): IObjectWrapper? = tag
|
||||
override fun getTag(): IObjectWrapper = tag ?: ObjectWrapper.wrap(null)
|
||||
|
||||
companion object {
|
||||
private val TAG = "GmsMapMarker"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user