From 7033c215c85b3b5900864b070a363532d29259ee Mon Sep 17 00:00:00 2001 From: Oh Jinkyun Date: Tue, 28 Aug 2018 15:00:48 +0900 Subject: [PATCH] Fix crash on Channels tab --- index.js | 2 ++ index.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/index.js b/index.js index 0dd1d66..ddeeb90 100755 --- a/index.js +++ b/index.js @@ -388,6 +388,8 @@ var SlackTUIView = /** @class */ (function () { _this.tui.focusTeamByName(teamName); }); this.channelBox.on('select', function (el, selected) { + if (!_this.tui.focusedTeam) + return; _this.tui.focusedTeam.selectChannel(el.getText()); }); this.userBox.on('select', function (el, selected) { diff --git a/index.ts b/index.ts index 43fb6a5..85f1ff0 100644 --- a/index.ts +++ b/index.ts @@ -420,6 +420,7 @@ Use cursor keys to choose item. }); this.channelBox.on('select', (el, selected) => { + if(!this.tui.focusedTeam) return; this.tui.focusedTeam.selectChannel(el.getText()); });