From 581d987b883be44f3429f4acf9954ceffebee15a Mon Sep 17 00:00:00 2001 From: thiemowmde Date: Fri, 30 Aug 2024 17:41:17 +0200 Subject: [PATCH] Fix null reference error in 2017 source editor Looking for other references can (as of now) never work in source mode. There are never other references or reference lists. Bug: T373661 Change-Id: Icaad4e71a1538c5fad6a0f016b342a7cb7b9db2f --- modules/ve-cite/ve.dm.MWGroupReferences.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ve-cite/ve.dm.MWGroupReferences.js b/modules/ve-cite/ve.dm.MWGroupReferences.js index c4c8ee3c3..d40519b28 100644 --- a/modules/ve-cite/ve.dm.MWGroupReferences.js +++ b/modules/ve-cite/ve.dm.MWGroupReferences.js @@ -195,7 +195,8 @@ ve.dm.MWGroupReferences.prototype.getInternalModelNode = function ( key ) { * @return {ve.dm.MWReferenceNode[]} */ ve.dm.MWGroupReferences.prototype.getRefUsages = function ( key ) { - return ( this.nodeGroup.keyedNodes[ key ] || [] ) + // T373661: This might never have been set in source mode + return ( this.nodeGroup && this.nodeGroup.keyedNodes[ key ] || [] ) .filter( ( node ) => !node.getAttribute( 'placeholder' ) && !node.findParent( ve.dm.MWReferencesListNode ) );