Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Catch exception onMove #621

Merged
merged 3 commits into from
Dec 21, 2022
Merged

Conversation

boldtrn
Copy link
Collaborator

@boldtrn boldtrn commented Dec 19, 2022

This is an exception that showed up in our Crashlytics log.

Fatal Exception: java.lang.Error: latitude must not be NaN
       at com.mapbox.mapboxsdk.maps.NativeMapView.nativeMoveBy(NativeMapView.java)
       at com.mapbox.mapboxsdk.maps.NativeMapView.moveBy(NativeMapView.java:248)
       at com.mapbox.mapboxsdk.maps.Transform.moveBy(Transform.java:314)
       at com.mapbox.mapboxsdk.maps.MapGestureDetector$MoveGestureListener.onMove(MapGestureDetector.java:493)
       at com.mapbox.android.gestures.MoveGestureDetector.analyzeMovement(MoveGestureDetector.java:158)
       at com.mapbox.android.gestures.MultiFingerGesture.analyzeEvent(MultiFingerGesture.java:106)
       at com.mapbox.android.gestures.ProgressiveGesture.analyzeEvent(ProgressiveGesture.java:55)
       at com.mapbox.android.gestures.MoveGestureDetector.analyzeEvent(MoveGestureDetector.java:141)
       at com.mapbox.android.gestures.BaseGesture.analyze(BaseGesture.java:61)
       at com.mapbox.android.gestures.BaseGesture.onTouchEvent(BaseGesture.java:39)
       at com.mapbox.android.gestures.AndroidGesturesManager.onTouchEvent(AndroidGesturesManager.java:193)
       at com.mapbox.mapboxsdk.maps.MapGestureDetector.onTouchEvent(MapGestureDetector.java:218)
       at com.mapbox.mapboxsdk.maps.MapView.onTouchEvent(MapView.java:523)

@wipfli
Copy link
Contributor

wipfli commented Dec 20, 2022

Thanks for opening this pull request, @boldtrn. Do you know if there are unit tests where we could check that the library does the right thing even if distanceX is not a number?

@boldtrn
Copy link
Collaborator Author

boldtrn commented Dec 20, 2022

There are unit tests, I am not 100% sure if we can reproduce this error with the unit tests.

@artakka artakka merged commit 1439e05 into maplibre:main Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants