[Pkg-javascript-commits] [pdf.js] 108/246: Fix issue where pdfDocument is null

David Prévot taffit at moszumanska.debian.org
Sun Sep 7 15:36:31 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit eaa587753b2c7cd34a95de6bcf5bb662349f36e2
Author: Hengjie <hengjie at gmail.com>
Date:   Sun Aug 3 19:55:35 2014 +1200

    Fix issue where pdfDocument is null
    
    Happens when no file is loaded
---
 web/secondary_toolbar.js | 4 +++-
 web/viewer.js            | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/web/secondary_toolbar.js b/web/secondary_toolbar.js
index 2775016..7b6b585 100644
--- a/web/secondary_toolbar.js
+++ b/web/secondary_toolbar.js
@@ -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();
   },
 
diff --git a/web/viewer.js b/web/viewer.js
index f44d500..a363664 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -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;
         }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list