DLynch has uploaded a new change for review.

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

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

GeneratedContentNode: Check model existence before using

Hard to reproduce issue from the Math extension, where
MWExtensionPreviewDialog can occasionally set the preview dialog's model to
null because there's no node to preview. Extend the existing check for the
model being connected to see whether the model exists at all.

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


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/99/272999/1

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: newchange
Gerrit-Change-Id: I6ecfe8727156c5283f0fe85f000a7a5512f565b9
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch <[email protected]>

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

Reply via email to