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

[BUG] Crash in GestureListener.onFling #554

Closed
thats-bot opened this issue Sep 14, 2023 · 6 comments · Fixed by #555
Closed

[BUG] Crash in GestureListener.onFling #554

thats-bot opened this issue Sep 14, 2023 · 6 comments · Fixed by #555

Comments

@thats-bot
Copy link

thats-bot commented Sep 14, 2023

Looks like null values are not handled correctly in onFling function.
Please, make the first parameter nullable to fix this.
override fun onFling(e1: MotionEvent, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean {

Fatal Exception: java.lang.NullPointerException
Parameter specified as non-null is null: method li.e.onFling, parameter e1
com.ortiz.touchview.TouchImageView$GestureListener.onFling (TouchImageView.java:12)
android.view.GestureDetector.onTouchEvent (GestureDetector.java:835)
com.ortiz.touchview.TouchImageView$PrivateOnTouchListener.onTouch (TouchImageView.kt:851)
android.view.View.dispatchTouchEvent (View.java:15072)
android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:3923)
android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:3597)

Thanks

@thats-bot
Copy link
Author

First parameter should be nullable
override fun onFling(e1: MotionEvent?, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean {

@hannesa2
Copy link
Collaborator

And you are using a version < 3.3

@hannesa2
Copy link
Collaborator

@hannesa2
Copy link
Collaborator

image

@hannesa2
Copy link
Collaborator

Ahh sorry, moving to api34 needs this #555

@hannesa2 hannesa2 reopened this Sep 15, 2023
@hannesa2 hannesa2 mentioned this issue Sep 15, 2023
@thats-bot
Copy link
Author

@hannesa2 it was fast, thank you for the fix!

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 a pull request may close this issue.

2 participants