Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -676,8 +676,16 @@ |
677 | 677 | } |
678 | 678 | if ( mw.isDefined( mw.UploadWizard.config['altUploadForm'] ) && mw.UploadWizard.config['altUploadForm'] !== '' ) { |
679 | 679 | // altUploadForm is expected to be a page title like 'Commons:Upload', so convert to URL |
680 | | - var altUploadFormUrl = ( new mw.Title( mw.UploadWizard.config['altUploadForm'] ) ).getUrl(); |
681 | | - $j( '#contentSub' ).append( $j( '<span class="contentSubLink"></span>' ).msg( 'mwe-upwiz-subhead-alt-upload', $j( '<a></a>' ).attr( { href: altUploadFormUrl } ) ) ); |
| 680 | + var title; |
| 681 | + try { |
| 682 | + title = new mw.Title( mw.UploadWizard.config['altUploadForm'] ); |
| 683 | + } catch ( e ) { |
| 684 | + // page was empty, or impossible on this wiki (missing namespace or some other issue). Give up. |
| 685 | + } |
| 686 | + if ( title instanceof mw.Title ) { |
| 687 | + var altUploadFormUrl = title.getUrl(); |
| 688 | + $j( '#contentSub' ).append( $j( '<span class="contentSubLink"></span>' ).msg( 'mwe-upwiz-subhead-alt-upload', $j( '<a></a>' ).attr( { href: altUploadFormUrl } ) ) ); |
| 689 | + } |
682 | 690 | } |
683 | 691 | $j( '#contentSub .contentSubLink:not(:last)' ).after( ' · ' ); |
684 | 692 | |