mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-24 06:13:54 +00:00
Guard against undefined $container element in initMobile.js
In order to prevent spikes in JS errors, ensure that the $container element exists before initializing the mobile media viewer. Bug: T360781 Change-Id: I48a57e8008e7bd90e9fcfc783f3720f6f75520a7
This commit is contained in:
parent
278b5189bd
commit
cf723c00c3
|
@ -444,7 +444,12 @@ module.exports = function () {
|
|||
// setup toc icons
|
||||
mw.hook( 'wikipage.content' ).add( function ( $container ) {
|
||||
// If the MMV module is missing or disabled from the page, initialise our version
|
||||
if ( desktopMMV === null || desktopMMV === 'registered' ) {
|
||||
if (
|
||||
desktopMMV === null ||
|
||||
desktopMMV === 'registered' &&
|
||||
// T360781
|
||||
$container &&
|
||||
$container[ 0 ] ) {
|
||||
initMediaViewer( $container[ 0 ] );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue