From a1bf37e4577b393bbc4fcaa0ca6d71ef3e7a3fee Mon Sep 17 00:00:00 2001 From: Duco van Amstel Date: Wed, 7 Nov 2018 16:25:00 +0000 Subject: [PATCH] Do not join Slack channel without API access (slack) (#563) --- bridge/slack/slack.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index d2d118b2..924f4131 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -147,6 +147,11 @@ func (b *Bslack) Disconnect() error { // allow apps or bots to join channels themselves and they need to be invited // manually by a user. func (b *Bslack) JoinChannel(channel config.ChannelInfo) error { + // We can only join a channel through the Slack API. + if b.sc == nil { + return nil + } + b.populateChannels() channelInfo, err := b.getChannel(channel.Name)