diff --git a/app/assets/javascripts/discourse/models/user-badge.js.es6 b/app/assets/javascripts/discourse/models/user-badge.js.es6 index e3a6872432b..ebf44e5efd9 100644 --- a/app/assets/javascripts/discourse/models/user-badge.js.es6 +++ b/app/assets/javascripts/discourse/models/user-badge.js.es6 @@ -86,6 +86,9 @@ UserBadge.reopenClass({ @returns {Promise} a promise that resolves to an array of `UserBadge`. **/ findByUsername: function(username, options) { + if (!username) { + return Em.RSVP.resolve([]); + } var url = "/user-badges/" + username + ".json"; if (options && options.grouped) { url += "?grouped=true";