diff --git a/web/app.js b/web/app.js index ff7e5d912..66bacb9a5 100644 --- a/web/app.js +++ b/web/app.js @@ -1403,6 +1403,9 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) { const HOSTED_VIEWER_ORIGINS = ['null', 'http://mozilla.github.io', 'https://mozilla.github.io']; validateFileURL = function validateFileURL(file) { + if (file === undefined) { + return; + } try { let viewerOrigin = new URL(window.location.href).origin || 'null'; if (HOSTED_VIEWER_ORIGINS.indexOf(viewerOrigin) >= 0) {