Merge "Fix "null is not a string" error in event logging code"

This commit is contained in:
jenkins-bot 2022-07-28 10:41:15 +00:00 committed by Gerrit Code Review
commit 52c155f43f

View file

@ -392,8 +392,10 @@ ve.ui.MWTemplateDialog.prototype.getActionProcess = function ( action ) {
}
var parts = dialog.transclusionModel.getParts();
for ( var i = 0; i < parts.length; i++ ) {
if ( parts[ i ].getTitle ) {
templateEvent.template_names.push( parts[ i ].getTitle() );
// Only {@see ve.dm.MWTemplateModel} have a title
var title = parts[ i ].getTitle && parts[ i ].getTitle();
if ( title ) {
templateEvent.template_names.push( title );
}
}
mw.track( 'event.VisualEditorTemplateDialogUse', templateEvent );