Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/297280

Change subject: mw.UploadWizardUpload: Debugging for 'Uncaught TypeError: 
Cannot read property 'parseDom' of undefined'
......................................................................

mw.UploadWizardUpload: Debugging for 'Uncaught TypeError: Cannot read property 
'parseDom' of undefined'

Bug: T139132
Change-Id: I5b164d6ab3f5a9cce7fcf284340e722dd8666bdb
---
M resources/uw.FieldLayout.js
1 file changed, 13 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/80/297280/1

diff --git a/resources/uw.FieldLayout.js b/resources/uw.FieldLayout.js
index 1e24a04..e424af5 100644
--- a/resources/uw.FieldLayout.js
+++ b/resources/uw.FieldLayout.js
@@ -86,10 +86,19 @@
         * @inheritdoc
         */
        uw.FieldLayout.prototype.makeMessage = function ( kind, msg ) {
-               var
-                       content = msg.parseDom(),
-                       $listItem = 
uw.FieldLayout.parent.prototype.makeMessage.call( this, kind, content );
-               $listItem.addClass( 'mwe-upwiz-fieldLayout-' + kind + '-' + 
msg.key );
+               var content, $listItem;
+               if ( !msg ) {
+                       throw new Error(
+                               'makeMessage called with no msg' +
+                               ' widget=' + this.fieldWidget.constructor.name +
+                               ' value=' + ( this.fieldWidget.getSerialized ?
+                                       JSON.stringify( 
this.fieldWidget.getSerialized() ) :
+                                       this.fieldWidget.getValue() )
+                       );
+               }
+               content = msg.parseDom();
+               $listItem = uw.FieldLayout.parent.prototype.makeMessage.call( 
this, kind, content )
+                       .addClass( 'mwe-upwiz-fieldLayout-' + kind + '-' + 
msg.key );
                return $listItem;
        };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b164d6ab3f5a9cce7fcf284340e722dd8666bdb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <matma....@gmail.com>

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

Reply via email to