mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Fix issue where pdfDocument is null
Happens when no file is loaded
This commit is contained in:
parent
3fc746cf7c
commit
eaa587753b
2 changed files with 5 additions and 3 deletions
|
@ -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();
|
||||
},
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue