MWReferenceNode: Don't try to remove from the internal list if it's not added

Recent changes to setRoot in ve core (719f8c667) cause unroot to occur at a
point we weren't expecting, when adding a new reference.

Bug: T163267
Change-Id: If02ea08bb8b6db3be41d51ab44ce2a74cfe07914
This commit is contained in:
David Lynch 2017-04-20 02:35:50 -05:00 committed by Ed Sanders
parent 1fe0fb2e70
commit 4841b7496c

View file

@ -395,6 +395,10 @@ ve.dm.MWReferenceNode.prototype.addToInternalList = function () {
* Unregister the node from the internal list
*/
ve.dm.MWReferenceNode.prototype.removeFromInternalList = function () {
if ( !this.registeredListGroup ) {
// Don't try to remove if we haven't been added in the first place.
return;
}
this.getDocument().getInternalList().removeNode(
this.registeredListGroup,
this.registeredListKey,