mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Gracefully fail if the URL filename cannot be decoded.
This commit is contained in:
parent
e0796cef28
commit
d64bb603c8
1 changed files with 6 additions and 1 deletions
|
@ -385,7 +385,12 @@ var PDFView = {
|
|||
|
||||
setTitleUsingUrl: function pdfViewSetTitleUsingUrl(url) {
|
||||
this.url = url;
|
||||
document.title = decodeURIComponent(getFileName(url)) || url;
|
||||
try {
|
||||
document.title = decodeURIComponent(getFileName(url)) || url;
|
||||
} catch (Exception) {
|
||||
console.log('WARNING: Unable to decode: ' + getFileName(url));
|
||||
document.title = url;
|
||||
}
|
||||
},
|
||||
|
||||
open: function pdfViewOpen(url, scale, password) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue