Skip to content
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

Check for undefined #8640

Merged
merged 3 commits into from Jul 13, 2017
Merged

Check for undefined #8640

merged 3 commits into from Jul 13, 2017

Conversation

cmyksvoll
Copy link
Contributor

new URL(file, window.location.href) throws the following error in IE11 + iPad Safari when file is undefined:
Unable to get property 'replace' of undefined or null reference

new URL(file, window.location.href) throws the following error in IE11 + iPad Safari:
Unable to get property 'replace' of undefined or null reference
web/app.js Outdated
@@ -1404,6 +1404,9 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {
'http://mozilla.github.io', 'https://mozilla.github.io'];
validateFileURL = function validateFileURL(file) {
try {
if (file === undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this up out of the try/catch.

@brendandahl brendandahl merged commit 95093a5 into mozilla:master Jul 13, 2017
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
* Check for undefined

new URL(file, window.location.href) throws the following error in IE11 + iPad Safari:
Unable to get property 'replace' of undefined or null reference

* Adapting previous change to pdf.js code standards

Added curly braces

* Moved check for undefined above try/catch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants