trackSubscriber: data isn't required

Editor-fixing caused errors on some events which don't pass data in.

Introduced in 8f612fbe64.

Change-Id: I5c9471e6ffe4cdda0bf5455c80ef70251690e20f
This commit is contained in:
David Lynch 2017-12-13 11:56:35 -06:00
parent fde0c180aa
commit e66d58076f

View file

@ -95,7 +95,7 @@
}
// Convert mode=source/visual to editor name
if ( data.mode ) {
if ( data && data.mode ) {
data.editor = data.mode === 'source' ? 'wikitext-2017' : 'visualeditor';
delete data.mode;
}