Do not fail when name of the user performing the revision is not available

For example when user name is not visible due to RevisionDelete the script
crashed. This makes it check if there is a user name defined and not try
to show it if there is none.

Bug: T135198
Change-Id: I43ce0e49e13ad6262cc60fd938c486ea3e328e64
This commit is contained in:
Leszek Manicki 2016-05-31 15:06:38 +02:00 committed by Addshore
parent a2774984c4
commit 225f48ac52

View file

@ -56,9 +56,11 @@
var $tooltip = $( '<div>' )
.append(
$( '<p>' ).append( $( '<b>' ).text( rev.getFormattedDate() ) ),
$( '<bdi>' ).append( $( '<p>' ).text(
mw.msg( 'revisionslider-label-user', mw.html.escape( rev.getUser() ) )
) ),
rev.getUser() ?
$( '<bdi>' ).append( $( '<p>' ).text(
mw.msg( 'revisionslider-label-user', mw.html.escape( rev.getUser() ) )
) )
: '',
rev.getComment() ?
$( '<bdi>' ).append(
$( '<p>' ).append( $( '<i>' ).text(