mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-27 17:40:06 +00:00
Wrap the mw.Uri creation in a try-catch block
Bug: T261799 Change-Id: Ibaf027917f34d0591b7ebc669d9fbaff2f0bb442
This commit is contained in:
parent
1d9557248e
commit
5271e7a08d
|
@ -916,8 +916,8 @@
|
|||
function route( fileName ) {
|
||||
var fileTitle;
|
||||
comingFromHashChange = true;
|
||||
fileName = decodeURIComponent( fileName );
|
||||
try {
|
||||
fileName = decodeURIComponent( fileName );
|
||||
fileTitle = new mw.Title( fileName );
|
||||
this.loadImageByTitle( fileTitle );
|
||||
} catch ( err ) {
|
||||
|
|
|
@ -61,9 +61,13 @@
|
|||
uri;
|
||||
|
||||
if ( this.imageQueryParameter ) {
|
||||
uri = new mw.Uri( url );
|
||||
extraParam[ this.imageQueryParameter ] = null;
|
||||
url = uri.extend( extraParam ).toString();
|
||||
try {
|
||||
uri = new mw.Uri( url );
|
||||
extraParam[ this.imageQueryParameter ] = null;
|
||||
url = uri.extend( extraParam ).toString();
|
||||
} catch ( error ) {
|
||||
return $.Deferred().reject( error.message );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !this.cache[ cacheKey ] ) {
|
||||
|
|
Loading…
Reference in a new issue