mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-12 06:27:01 +00:00
ArticleTarget: Don't throw error on new heading node
Change-Id: I4e0566de9ffa2112d99d9d574621ce57ce8b37f2
This commit is contained in:
parent
b9d1106eb0
commit
2fb7b81caf
|
@ -2114,7 +2114,7 @@ ve.init.mw.ArticleTarget.prototype.restoreEditSection = function () {
|
|||
dmDoc.getNodesByType( 'mwHeading' ).some( ( heading ) => {
|
||||
const domElements = heading.getOriginalDomElements( dmDoc.getStore() );
|
||||
if (
|
||||
domElements && domElements[ 0 ].nodeType === Node.ELEMENT_NODE &&
|
||||
domElements && domElements.length && domElements[ 0 ].nodeType === Node.ELEMENT_NODE &&
|
||||
domElements[ 0 ].getAttribute( 'data-mw-section-id' ) === section
|
||||
) {
|
||||
headingModel = heading;
|
||||
|
|
Loading…
Reference in a new issue