Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit fc7e548

Browse files
author
Yuriy Bereguliak
committed
DImuthuUpe#619: fixed NPE while getPageAtOffset.
1 parent 690e2cf commit fc7e548

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/DragPinchManager.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ public boolean onSingleTapConfirmed(MotionEvent e) {
8383

8484
private boolean checkLinkTapped(float x, float y) {
8585
PdfFile pdfFile = pdfView.pdfFile;
86+
if (pdfFile == null) {
87+
return false;
88+
}
8689
float mappedX = -pdfView.getCurrentXOffset() + x;
8790
float mappedY = -pdfView.getCurrentYOffset() + y;
8891
int page = pdfFile.getPageAtOffset(pdfView.isSwipeVertical() ? mappedY : mappedX, pdfView.getZoom());

0 commit comments

Comments
 (0)