From 9de915182689f266a47ebcade0000b9d03cf2c6d Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 5 Mar 2018 22:50:38 +0100 Subject: [PATCH] Fix panic on sending messages between reconnects (irc). Closes #385 --- bridge/irc/irc.go | 5 +++++ 1 file changed, 5 insertions(+) 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)