Skip to content

Commit 661d488

Browse files
committed
Check if .pdfHistory exists before using it
1 parent d82475b commit 661d488

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

pdf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57029,7 +57029,7 @@ window.addEventListener('resize', function webViewerResize(evt) {
5702957029
});
5703057030

5703157031
window.addEventListener('hashchange', function webViewerHashchange(evt) {
57032-
if (PDFViewerApplication.pdfHistory.isHashChangeUnlocked) {
57032+
if (PDFViewerApplication.pdfHistory && PDFViewerApplication.pdfHistory.isHashChangeUnlocked) {
5703357033
var hash = document.location.hash.substring(1);
5703457034
if (!hash) {
5703557035
return;

pdf.js.patch

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--- pdf.orig.js 2015-11-18 21:52:24.078627247 -0400
2-
+++ pdf.js 2015-11-18 21:56:26.518621029 -0400
2+
+++ pdf.js 2015-11-18 22:32:56.866564854 -0400
33
@@ -49719,10 +49719,17 @@
44
var PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading';
55
var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000;
@@ -65,6 +65,15 @@
6565

6666
document.addEventListener('pagerendered', function (e) {
6767
var pageNumber = e.detail.pageNumber;
68+
@@ -57015,7 +57029,7 @@
69+
});
70+
71+
window.addEventListener('hashchange', function webViewerHashchange(evt) {
72+
- if (PDFViewerApplication.pdfHistory.isHashChangeUnlocked) {
73+
+ if (PDFViewerApplication.pdfHistory && PDFViewerApplication.pdfHistory.isHashChangeUnlocked) {
74+
var hash = document.location.hash.substring(1);
75+
if (!hash) {
76+
return;
6877
@@ -57168,6 +57182,9 @@
6978
}, true);
7079

0 commit comments

Comments
 (0)