-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Additional check to ensure pdfViewer object is defined before handleMouseWheel event accesses its property isInPresentationMode #7778
Conversation
@@ -2000,7 +2000,7 @@ function webViewerPageChanging(e) { | |||
var zoomDisabled = false, zoomDisabledTimeout; | |||
function handleMouseWheel(evt) { | |||
var pdfViewer = PDFViewerApplication.pdfViewer; | |||
if (pdfViewer.isInPresentationMode) { | |||
if (pdfViewer && pdfViewer.isInPresentationMode) { |
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.
If the pdfViewer
object is not defined, then we may also be in trouble in the other parts of this function (for example here: https://github.com/mozilla/pdf.js/pull/7778/files#diff-529d1853ee1bba753a0fcb40ea778723R2032). Therefore, I think it would be better to change this line to if (!pdfViewer || pdfViewer.isInPresentationMode) {
. That way we get out if pdfViewer
is not defined (to avoid more issues) and also when we're in presentation mode.
Looks good to me with the comment adressed. Make sure that after your changes there is still one commit by squashing the commits. Refer to https://github.com/mozilla/pdf.js/wiki/Squashing-Commits for how to do that easily. |
…ouseWheel event accesses its property isInPresentationMode
f62d735
to
7fec8de
Compare
Awesome, thanks! I made the change. |
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/729859bab16fb41/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/729859bab16fb41/output.txt Total script time: 2.71 mins Published |
Thank you! |
…ousewheel-handler Additional check to ensure pdfViewer object is defined before handleMouseWheel event accesses its property isInPresentationMode
Additional check to ensure pdfViewer object is defined before handleMouseWheel event accesses its property isInPresentationMode