Skip to content

Commit 868cc82

Browse files
author
li_zhe-pc
committed
fix the bug that the viewer will crash when the function---getPageCount equals zero while pdf file is loading
1 parent 94f7b78 commit 868cc82

File tree

1 file changed

+3
-0
lines changed
  • android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,9 @@ ScrollDir getScrollDir() {
10051005
}
10061006

10071007
void loadPageByOffset() {
1008+
if(0==getPageCount()){
1009+
return ;
1010+
}
10081011
float offset, optimal, screenCenter;
10091012
float spacingPerPage = spacingPx - (spacingPx / getPageCount());
10101013
if (swipeVertical) {

0 commit comments

Comments
 (0)