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

Change subject: Fix crash in MWExtensionNode creation mode
......................................................................


Fix crash in MWExtensionNode creation mode

We can't get the directionality from the focused node if there isn't one.

This doesn't add any logic to determine the directionality in creation
mode, filed https://bugzilla.wikimedia.org/show_bug.cgi?id=57421 for that.

Change-Id: I3ff8d48f19c7beef5e24b55712a26d86efa5812a
---
M modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js
1 file changed, 6 insertions(+), 4 deletions(-)

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



diff --git a/modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js 
b/modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js
index 826db7a..bb9126f 100644
--- a/modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js
+++ b/modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js
@@ -66,10 +66,12 @@
        this.node = this.surface.getView().getFocusedNode();
        this.input.setValue( this.node ? this.node.getModel().getAttribute( 
'mw' ).body.extsrc : '' );
 
-       // Direction of the input textarea should correspond to the
-       // direction of the surrounding content of the node itself
-       // rather than the GUI direction:
-       this.input.setRTL( this.node.$element.css( 'direction' ) === 'rtl' );
+       if ( this.node ) {
+               // Direction of the input textarea should correspond to the
+               // direction of the surrounding content of the node itself
+               // rather than the GUI direction:
+               this.input.setRTL( this.node.$element.css( 'direction' ) === 
'rtl' );
+       }
 };
 
 /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3ff8d48f19c7beef5e24b55712a26d86efa5812a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Mooeypoo <mor...@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