From 8f5349eaa141e08b557b16080ea02e568fee9858 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 6 Mar 2018 21:37:38 +0800 Subject: [PATCH] FIX: Only unsubscribe channel if it was subscribed. --- .../javascripts/discourse/controllers/user-topics-list.js.es6 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/user-topics-list.js.es6 b/app/assets/javascripts/discourse/controllers/user-topics-list.js.es6 index 956557c14ea..9f877a1bb38 100644 --- a/app/assets/javascripts/discourse/controllers/user-topics-list.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-topics-list.js.es6 @@ -31,7 +31,8 @@ export default Ember.Controller.extend({ }, unsubscribe() { - this.messageBus.unsubscribe(this.get('channel')); + const channel = this.get('channel'); + if (channel) this.messageBus.unsubscribe(channel); this._resetTracking(); this.set('channel', null); },