From 878a29b7279fc9446ceed4c5976c9208b83fe687 Mon Sep 17 00:00:00 2001 From: thiemowmde Date: Thu, 5 Sep 2024 17:54:50 +0200 Subject: [PATCH] Add extra safe-guard to ve.ui.MWCitationDialogTool Note this doesn't fully solve T374068. The issue is probably that the reuse tab shouldn't be visible in the first place. Still I think this is a useful safe-guard that cannot hurt. We are doing the same in almost all other places already. Bug: T374068 Change-Id: I9b91374dbda74af75d8c36e24ffe5b9448da1aa7 --- modules/ve-cite/ve.ui.MWCitationDialogTool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ve-cite/ve.ui.MWCitationDialogTool.js b/modules/ve-cite/ve.ui.MWCitationDialogTool.js index 13866bacb..7409588e7 100644 --- a/modules/ve-cite/ve.ui.MWCitationDialogTool.js +++ b/modules/ve-cite/ve.ui.MWCitationDialogTool.js @@ -49,7 +49,7 @@ ve.ui.MWCitationDialogTool.static.isCompatibleWith = function ( model ) { // Check if content of the reference node contains only a template with the same name as // this.template const internalItem = model.getInternalItem(); - const branches = internalItem.getChildren(); + const branches = internalItem ? internalItem.getChildren() : []; if ( branches.length === 1 && branches[ 0 ].canContainContent() ) { const leaves = branches[ 0 ].getChildren(); if ( leaves.length === 1 && leaves[ 0 ] instanceof ve.dm.MWTransclusionNode ) {