FIX: Error viewing user page when not logged in.

This commit is contained in:
Robin Ward 2013-06-11 12:58:12 -04:00
parent 82116d5db5
commit 0cbf7c2417
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ Discourse.UserRoute = Discourse.Route.extend({
// If we're viewing the currently logged in user, return that object
// instead.
var currentUser = Discourse.User.current();
if (params.username.toLowerCase() === currentUser.get('username_lower')) {
if (currentUser && (params.username.toLowerCase() === currentUser.get('username_lower'))) {
return currentUser;
}