summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-03-05 22:50:38 +0100
committerWim <wim@42.be>2018-03-05 22:50:38 +0100
commit9de915182689f266a47ebcade0000b9d03cf2c6d (patch)
treea2360377cf6e738ac9bdb0b1bcb9f3645046189d
parentfdd5ada98c3829af78d662da90d12d574565ac7a (diff)
downloadmatterbridge-msglm-9de915182689f266a47ebcade0000b9d03cf2c6d.tar.gz
matterbridge-msglm-9de915182689f266a47ebcade0000b9d03cf2c6d.tar.bz2
matterbridge-msglm-9de915182689f266a47ebcade0000b9d03cf2c6d.zip
Fix panic on sending messages between reconnects (irc). Closes #385
-rw-r--r--bridge/irc/irc.go5
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)