Catrope has uploaded a new change for review.

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


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.

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/84/96984/1

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: newchange
Gerrit-Change-Id: I3ff8d48f19c7beef5e24b55712a26d86efa5812a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <roan.katt...@gmail.com>

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

Reply via email to