Fix issue where pdfDocument is null

Happens when no file is loaded
This commit is contained in:
Hengjie 2014-08-03 19:55:35 +12:00
parent 3fc746cf7c
commit eaa587753b
2 changed files with 5 additions and 3 deletions

View File

@ -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();
},

View File

@ -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;
}