mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Fix "null is not a string" error in event logging code
This getTitle() method can return null. Bug: T299779 Change-Id: I33c6fc0cdd03ae45a04d4098cf101dc9fa3414e3
This commit is contained in:
parent
3a0b3e07d5
commit
cf77557a95
|
@ -396,8 +396,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 );
|
||||
|
|
Loading…
Reference in a new issue