jenkins-bot has submitted this change and it was merged. Change subject: Make sure initialHash exists before checking its value ......................................................................
Make sure initialHash exists before checking its value (Followup on If17b50cc4a39993) Make sure initialHash is set before checking and changing its value in the MWImageModel method. If a user chooses a brand new image to insert into the document (an insertion rather than update) then the initial hash is empty, and changing its values will fail with an error message. Bug: 72492 Change-Id: I3f9ea74891cc0ab77a07fa5d4e9cbc591f5b93e6 --- M modules/ve-mw/dm/models/ve.dm.MWImageModel.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/dm/models/ve.dm.MWImageModel.js b/modules/ve-mw/dm/models/ve.dm.MWImageModel.js index fe70d3e..b0cd7b2 100644 --- a/modules/ve-mw/dm/models/ve.dm.MWImageModel.js +++ b/modules/ve-mw/dm/models/ve.dm.MWImageModel.js @@ -1066,7 +1066,7 @@ // We have to adjust the details in the initial hash if the original // image was 'default' since we didn't have default until now and the // default dimensions that were 'recorded' were wrong - if ( this.initialHash.scalable.isDefault ) { + if ( !$.isEmptyObject( this.initialHash ) && this.initialHash.scalable.isDefault ) { this.initialHash.scalable.currentDimensions = this.scalable.getDefaultDimensions(); } -- To view, visit https://gerrit.wikimedia.org/r/168675 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3f9ea74891cc0ab77a07fa5d4e9cbc591f5b93e6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Mooeypoo <mor...@gmail.com> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits