Nikerabbit has submitted this change and it was merged.

Change subject: Check for null value of template params to avoid js error
......................................................................


Check for null value of template params to avoid js error

Bug: T151621
Change-Id: Ibe9c6c499a2a0848f31ce66f16c734a6bd35be5a
---
M modules/tools/ext.cx.tools.template.editor.js
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/modules/tools/ext.cx.tools.template.editor.js 
b/modules/tools/ext.cx.tools.template.editor.js
index 01bcb98..c7a0b3e 100644
--- a/modules/tools/ext.cx.tools.template.editor.js
+++ b/modules/tools/ext.cx.tools.template.editor.js
@@ -352,8 +352,8 @@
                        option = new mw.cx.widgets.TemplateParamOptionWidget( {
                                data: key,
                                classes: [ 
'cx-template-editor-param-selector-item' ],
-                               label: value.label && value.label[ language ] 
|| key,
-                               description: value.description && 
value.description[ language ]
+                               label: value && value.label && value.label[ 
language ] || key,
+                               description: value && value.description && 
value.description[ language ] || ''
                        } );
                        option.$element.append( $desc );
                        items.push( option );
@@ -449,7 +449,7 @@
                } );
 
                $.each( this.targetTemplate.params, function ( key, value ) {
-                       if ( value.changed ) {
+                       if ( value && value.changed ) {
                                if ( !value.html || !isNaN( value.html ) ) {
                                        // Value cleared/deleted/a number. Save 
an API call.
                                        value.wt = value.html;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe9c6c499a2a0848f31ce66f16c734a6bd35be5a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to