mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 08:20:02 +00:00
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
This commit is contained in:
parent
2890772a9f
commit
878a29b727
|
@ -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
|
// Check if content of the reference node contains only a template with the same name as
|
||||||
// this.template
|
// this.template
|
||||||
const internalItem = model.getInternalItem();
|
const internalItem = model.getInternalItem();
|
||||||
const branches = internalItem.getChildren();
|
const branches = internalItem ? internalItem.getChildren() : [];
|
||||||
if ( branches.length === 1 && branches[ 0 ].canContainContent() ) {
|
if ( branches.length === 1 && branches[ 0 ].canContainContent() ) {
|
||||||
const leaves = branches[ 0 ].getChildren();
|
const leaves = branches[ 0 ].getChildren();
|
||||||
if ( leaves.length === 1 && leaves[ 0 ] instanceof ve.dm.MWTransclusionNode ) {
|
if ( leaves.length === 1 && leaves[ 0 ] instanceof ve.dm.MWTransclusionNode ) {
|
||||||
|
|
Loading…
Reference in a new issue