ve.ui.MWLiveExtensionInspector: Account for this.selectedNode being null in debounced method

Change-Id: I74ab091d3bfbdd9290429cd50688f458118701e7
This commit is contained in:
Ed Sanders 2023-01-26 17:58:00 +00:00
parent 0b1f41a07d
commit 420c0f6c10

View file

@ -126,6 +126,10 @@ ve.ui.MWLiveExtensionInspector.prototype.onChange = function () {
* Update the node rendering to reflect the current content in the inspector.
*/
ve.ui.MWLiveExtensionInspector.prototype.updatePreview = function () {
if ( !this.selectedNode ) {
// Method is called debounced, so selectedNode may not still exist
return;
}
var mwData = ve.copy( this.selectedNode.getAttribute( 'mw' ) );
this.updateMwData( mwData );