Not all pages in a MediaWiki installation have an edit link. For
example the pages in Wikidata do not have it.
Bug: 57713
Change-Id: I842c1224d15887d59eab73f2b222c232a05c0bd9
if ( parseInt( mw.user.options.get( 'editondblclick' ), 10 ) ) {
e.preventDefault();
// Trigger native HTMLElement click instead of opening URL (bug 43052)
- $( '#ca-edit a' ).get( 0 ).click();
+ var $a = $( '#ca-edit a' );
+ // Not every page has an edit link (bug 57713)
+ if ( $a.length ) {
+ $a.get( 0 ).click();
+ }
}
} );
} );