diff options
author | Wim <wim@42.be> | 2018-03-05 22:50:38 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2018-03-05 22:50:38 +0100 |
commit | 9de915182689f266a47ebcade0000b9d03cf2c6d (patch) | |
tree | a2360377cf6e738ac9bdb0b1bcb9f3645046189d /bridge/irc/irc.go | |
parent | fdd5ada98c3829af78d662da90d12d574565ac7a (diff) | |
download | matterbridge-msglm-9de915182689f266a47ebcade0000b9d03cf2c6d.tar.gz matterbridge-msglm-9de915182689f266a47ebcade0000b9d03cf2c6d.tar.bz2 matterbridge-msglm-9de915182689f266a47ebcade0000b9d03cf2c6d.zip |
Fix panic on sending messages between reconnects (irc). Closes #385
Diffstat (limited to 'bridge/irc/irc.go')
-rw-r--r-- | bridge/irc/irc.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go index 8053bb4b..0e817327 100644 --- a/bridge/irc/irc.go +++ b/bridge/irc/irc.go @@ -159,6 +159,11 @@ func (b *Birc) Send(msg config.Message) (string, error) { b.Log.Debugf("=> Receiving %#v", msg) + // we can be in between reconnects #385 + if !b.i.IsConnected() { + b.Log.Error("Not connected to server, dropping message") + } + // Execute a command if strings.HasPrefix(msg.Text, "!") { b.Command(&msg) |