jenkins-bot has submitted this change and it was merged.

Change subject: Avoid a js error at mw.cx.getSourceSection when id is null
......................................................................


Avoid a js error at mw.cx.getSourceSection when id is null

Bug: T95151
Change-Id: Idb828031e750333c835444294b9f50f8b0229b0e
---
M modules/util/ext.cx.util.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Nikerabbit: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/util/ext.cx.util.js b/modules/util/ext.cx.util.js
index 506aac5..5d42c36 100644
--- a/modules/util/ext.cx.util.js
+++ b/modules/util/ext.cx.util.js
@@ -39,7 +39,7 @@
 
        mw.cx.getSourceSection = function ( id ) {
                // Sanity check, id should be either a number or prefixed with 
cx
-               if ( isNaN( id ) && id.indexOf( 'cx' ) !== 0 ) {
+               if ( !id || ( isNaN( id ) && id.indexOf( 'cx' ) !== 0 ) ) {
                        return $( [] );
                } else {
                        return $( document.getElementById( id ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/202327
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idb828031e750333c835444294b9f50f8b0229b0e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to