FIX: Only unsubscribe channel if it was subscribed.

This commit is contained in:
Guo Xiang Tan 2018-03-06 21:37:38 +08:00
parent e09a4a353e
commit 8f5349eaa1
1 changed files with 2 additions and 1 deletions

View File

@ -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);
},