fix user profiles not loading when logged out

This commit is contained in:
Yaman Qalieh 2016-09-26 18:58:15 -04:00
parent 2f078dc8bf
commit f6b6fd5389

View File

@ -57,7 +57,7 @@ Router.route('/user/:email', {
}, },
action: function() { action: function() {
if(Meteor.users.findOne({'services.google.email': this.params.email}) !== undefined) { if(Meteor.users.findOne({'services.google.email': this.params.email}) !== undefined) {
if(this.params.email === Meteor.user().services.google.email) { if(Meteor.user() && this.params.email === Meteor.user().services.google.email) {
this.redirect('/profile'); this.redirect('/profile');
} else { } else {
this.render('user'); this.render('user');