Skip to content

Commit

Permalink
Merge pull request #5127 from Hengjie/fix-pdfdocument-null
Browse files Browse the repository at this point in the history
Fix issue where pdfDocument is null
  • Loading branch information
Snuffleupagus committed Aug 4, 2014
2 parents 3fc746c + eaa5877 commit 87de3cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion web/secondary_toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ var SecondaryToolbar = {
},

lastPageClick: function secondaryToolbarLastPageClick(evt) {
PDFView.page = PDFView.pdfDocument.numPages;
if (PDFView.pdfDocument) {
PDFView.page = PDFView.pdfDocument.numPages;
}
this.close();
},

Expand Down
4 changes: 2 additions & 2 deletions web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2376,8 +2376,8 @@ window.addEventListener('keydown', function keydown(evt) {
}
break;
case 35: // end
if (PresentationMode.active ||
PDFView.page < PDFView.pdfDocument.numPages) {
if (PresentationMode.active || (PDFView.pdfDocument &&
PDFView.page < PDFView.pdfDocument.numPages)) {
PDFView.page = PDFView.pdfDocument.numPages;
handled = true;
}
Expand Down

0 comments on commit 87de3cd

Please sign in to comment.