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

Change subject: GeneratedContentNode: Check model existence before using
......................................................................


GeneratedContentNode: Check model existence before using

Hard to reproduce issue from the Math extension, where
MWExtensionPreviewDialog sometimes replaces its current MWMathNode before its
content-generating promises are complete. Thus extend the existing check for
the model being connected to see whether the node has been destroyed.

Bug: T121162
Change-Id: I6ecfe8727156c5283f0fe85f000a7a5512f565b9
---
M src/ce/nodes/ve.ce.GeneratedContentNode.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/ce/nodes/ve.ce.GeneratedContentNode.js 
b/src/ce/nodes/ve.ce.GeneratedContentNode.js
index d731e34..714fda9 100644
--- a/src/ce/nodes/ve.ce.GeneratedContentNode.js
+++ b/src/ce/nodes/ve.ce.GeneratedContentNode.js
@@ -296,7 +296,7 @@
 
        // Because doneGenerating is invoked asynchronously, the model node may 
have become detached
        // in the meantime. Handle this gracefully.
-       if ( this.model.doc ) {
+       if ( this.model && this.model.doc ) {
                store = this.model.doc.getStore();
                hash = OO.getHash( [ this.model.getHashObjectForRendering(), 
config ] );
                store.index( generatedContents, hash );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6ecfe8727156c5283f0fe85f000a7a5512f565b9
Gerrit-PatchSet: 2
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch <[email protected]>
Gerrit-Reviewer: DLynch <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: Tchan <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to