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

Crash when dismissing while zooming animation plays #15

Open
aavina opened this issue Jul 17, 2018 · 0 comments
Open

Crash when dismissing while zooming animation plays #15

aavina opened this issue Jul 17, 2018 · 0 comments

Comments

@aavina
Copy link

aavina commented Jul 17, 2018

We ran into an issue posted on Rollbar and figured out it's happening when the PDFView zoom animation is, playing due to a double tap, and the user dismisses the PDFView. Our parent view, which is a Dialog-based class, contains a button to close the PDFView and Dialog. The user can also click the Back button to do the same action.

We fixed this by overriding our onBackPressed() in the parent Dialog as well as that dismiss button and checking if the view PDFView.isZooming() If it is, we PDFView.resetZoomWithAnimation() instead of dismissing.

I'm posting it here just in case maintainers would like to enhance the PDFView to avoid the crash. If you don't see this as an issue, feel free to close, or let me know if you'd like me to close it.

Thanks,
Anthony

Versions of library in use

implementation 'com.github.barteksc:android-pdf-viewer:1.6.0'
implementation 'com.github.barteksc:pdfium-android:1.9.0'

Stacktrace

java.lang.NullPointerException: Attempt to read from field 'long com.shockwave.pdfium.PdfDocument.mNativeDocPtr' on a null object reference
1 at com.shockwave.pdfium.PdfiumCore.openPage (PdfiumCore.java:166)
2 at com.github.barteksc.pdfviewer.PDFView.loadPage (PDFView.java:706)
3 at com.github.barteksc.pdfviewer.PDFView.loadPages (PDFView.java:664)
4 at com.github.barteksc.pdfviewer.AnimationManager$ZoomAnimation.onAnimationEnd (AnimationManager.java:153)
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

No branches or pull requests

1 participant