Fix rare crash LatLngAnimator (#3352)

This commit is contained in:
Bart Louwers
2025-04-02 21:12:20 +02:00
committed by GitHub
parent 5a368624ec
commit b022d4878d
2 changed files with 15 additions and 1 deletions

View File

@@ -583,6 +583,15 @@ class LocationAnimatorCoordinatorTest {
assertFalse(locationAnimatorCoordinator.animatorArray[ANIMATOR_CAMERA_LATLNG].isStarted)
}
// regression test for crash https://github.com/maplibre/maplibre-native/issues/3294
@Test
fun resetAllCameraAnimations_null_target() {
locationAnimatorCoordinator.feedNewLocation(Location(""), CameraPosition.DEFAULT, true)
val cameraPosition = CameraPosition.Builder().build()
locationAnimatorCoordinator.resetAllCameraAnimations(cameraPosition, false)
}
@Test
fun cancelZoomAnimators() {
locationAnimatorCoordinator.feedNewZoomLevel(