Merge "Fix null reference error in 2017 source editor"

This commit is contained in:
jenkins-bot 2024-09-02 09:23:12 +00:00 committed by Gerrit Code Review
commit 4b92287348

View file

@ -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 )
);