add some protection so it works if currentUser is missing somehow

This commit is contained in:
Sam Saffron 2016-02-03 19:04:23 +11:00
parent bc75010b20
commit 835bedca67
1 changed files with 3 additions and 1 deletions

View File

@ -5,8 +5,10 @@ const TopicCategoryComponent = Ember.Component.extend({
secondRowItems: function() { return []; }.property(),
pmPath: function() {
return this.get('currentUser').pmPath(this.get('topic'));
var currentUser = this.get('currentUser');
return currentUser && currentUser.pmPath(this.get('topic'));
}.property('topic'),
showPrivateMessageGlyph: function() {
return !this.get('topic.is_warning') && this.get('topic.isPrivateMessage');
}.property('topic.is_warning', 'topic.isPrivateMessage'),