From 835bedca67ebfee004827c6cebfdc38717e5f7fa Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Wed, 3 Feb 2016 19:04:23 +1100 Subject: [PATCH] add some protection so it works if currentUser is missing somehow --- .../javascripts/discourse/components/header-extra-info.js.es6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/header-extra-info.js.es6 b/app/assets/javascripts/discourse/components/header-extra-info.js.es6 index b71d9b1b145..2182f3ea347 100644 --- a/app/assets/javascripts/discourse/components/header-extra-info.js.es6 +++ b/app/assets/javascripts/discourse/components/header-extra-info.js.es6 @@ -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'),