WordPress.org

Making WordPress.org

Changeset 6845


Ignore:
Timestamp:
03/08/2018 06:30:45 PM (3 months ago)
Author:
SergeyBiryukov
Message:

Trac: Avoid a JS error if wpTracCurrentUser is not defined, e.g. on Plugins Trac.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js

    r6668 r6845  
    6161    wpTrac = {
    6262
    63         gardener: typeof wpBugGardener !== 'undefined',
    64         currentUser: wpTracCurrentUser,
     63        gardener: 'undefined' !== typeof wpBugGardener,
     64        currentUser: 'undefined' !== typeof wpTracCurrentUser ? wpTracCurrentUser : '',
    6565
    6666        init: function() {
     
    772772
    773773                    // Exclude current user.
    774                     if ( 'undefined' !== wpTrac.currentUser ) {
     774                    if ( wpTrac.currentUser ) {
    775775                        users = $.grep( users, function( user ) {
    776776                            return user !== wpTrac.currentUser;
Note: See TracChangeset for help on using the changeset viewer.