Skip to content

Commit 431af8c

Browse files
authored
Merge pull request mozilla#7652 from Snuffleupagus/resize-event-handler-prevent-error-before-eventBus-initialized
Prevent errors if the 'resize' event is fired before the `eventBus` has been initialized
2 parents 15e1ae4 + 1a2f142 commit 431af8c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

web/app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,6 +1803,9 @@ function webViewerUpdateViewarea(e) {
18031803
}
18041804

18051805
window.addEventListener('resize', function webViewerResize(evt) {
1806+
if (!PDFViewerApplication.eventBus) {
1807+
return;
1808+
}
18061809
PDFViewerApplication.eventBus.dispatch('resize');
18071810
});
18081811

0 commit comments

Comments
 (0)