Fix: safely handle refs which have no "firstNode"

This can apparently happen when pasting refs from another document.

Bug: T247921
Change-Id: Ibe8c4d1625d2b6c9a11d9b4fea85c305f84265fa
This commit is contained in:
Adam Wight 2024-07-12 12:41:01 +02:00
parent 08969af51c
commit a0af51b476

View file

@ -61,7 +61,7 @@ ve.dm.MWDocumentReferences.prototype.getGroupRefsByParents = function ( groupNam
const seenTopLevelNames = new Set(
indexOrder
.map( ( index ) => nodeGroup.firstNodes[ index ] )
.filter( ( node ) => !node.element.attributes.extendsRef )
.filter( ( node ) => node && !node.element.attributes.extendsRef )
.map( ( node ) => node.element.attributes.listKey )
.filter( ( listKey ) => listKey )
);