From a0af51b47648260129892091ed177c72fcc204e5 Mon Sep 17 00:00:00 2001 From: Adam Wight Date: Fri, 12 Jul 2024 12:41:01 +0200 Subject: [PATCH] Fix: safely handle refs which have no "firstNode" This can apparently happen when pasting refs from another document. Bug: T247921 Change-Id: Ibe8c4d1625d2b6c9a11d9b4fea85c305f84265fa --- modules/ve-cite/ve.dm.MWDocumentReferences.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ve-cite/ve.dm.MWDocumentReferences.js b/modules/ve-cite/ve.dm.MWDocumentReferences.js index c8fb6ffed..505aa1292 100644 --- a/modules/ve-cite/ve.dm.MWDocumentReferences.js +++ b/modules/ve-cite/ve.dm.MWDocumentReferences.js @@ -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 ) );