Fixes: Error: Bad constructor arguments

Change-Id: I2f1146946bfb96d50f9580f2f7a9bd5dcb926ef1
This commit is contained in:
jdlrobson 2020-09-17 09:52:10 -07:00
parent 9fbd0aae6f
commit 29efc96cd5

View file

@ -619,7 +619,13 @@
// Add section is currently a wikitext-only feature
'#ca-addsection a'
).each( function () {
var linkUri = new mw.Uri( this.href );
var linkUri;
try {
linkUri = new mw.Uri( this.href );
} catch ( e ) {
// T66884
return;
}
if ( 'action' in linkUri.query ) {
delete linkUri.query.action;
linkUri.query.veaction = 'editsource';