-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue where pdfDocument is null #5127
Conversation
@@ -101,7 +101,9 @@ var SecondaryToolbar = { | |||
}, | |||
|
|||
lastPageClick: function secondaryToolbarLastPageClick(evt) { | |||
PDFView.page = PDFView.pdfDocument.numPages; | |||
if ( PDFView.pdfDocument !== null ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be simplified slightly (also the formatting isn't completely correct), please change it to:
if (PDFView.pdfDocument) {
Once you've addressed this, please squash the commits: https://github.com/mozilla/pdf.js/wiki/Squashing-Commits.
The same issue can also happen when the user presses the End key, hence I suggest solving that case as well here. Changing lines https://github.com/mozilla/pdf.js/blob/master/web/viewer.js#L2379-L2380 to e.g. the following might work: if (PresentationMode.active || (PDFView.pdfDocument &&
PDFView.page < PDFView.pdfDocument.numPages)) { |
Sure, I'll change those and squash. :) |
Happens when no file is loaded
Alright done, let me know if there are any other changes that I should make. |
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/01aecf0715f0d71/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/01aecf0715f0d71/output.txt Total script time: 0.90 mins Published
|
Fix issue where pdfDocument is null
Looks good; thanks for the patch! |
Happens when no file is loaded