From f282d403423cfd7cdd1569d67d23fbc3c78558b1 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Thu, 20 Aug 2026 10:35:51 +0000 Subject: [PATCH] Fix: Undefined tab panel TypeError in CreateWiki form --- modules/ext.createwiki.oouiform.ooui.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/ext.createwiki.oouiform.ooui.js b/modules/ext.createwiki.oouiform.ooui.js index 07706e91b7..2e6bf1f77e 100644 --- a/modules/ext.createwiki.oouiform.ooui.js +++ b/modules/ext.createwiki.oouiform.ooui.js @@ -6,6 +6,9 @@ tabs.$element.addClass( 'ext-createwiki-tabs-infused' ); function enhancePanel( panel ) { + if ( !panel || !panel.$element ) { + return; + } const $infuse = $( panel.$element ).find( '.ext-createwiki-infuse' ); $infuse.each( function () { try { @@ -82,7 +85,10 @@ if ( hash.match( /^#mw-[\w-]+/ ) ) { detectHash(); } else if ( hash === '' ) { - switchCreateWikiTab( $( '[id*=mw-section-]' ).attr( 'id' ), true ); + const $firstSection = $( '[id*=mw-section-]' ); + if ( $firstSection.length ) { + switchCreateWikiTab( $firstSection.attr( 'id' ), true ); + } } } ) // Run the function immediately to select the proper tab on startup.