From df5bce27b04e4942ca71a1d1d75c4cb73cdb39de Mon Sep 17 00:00:00 2001 From: Wim Date: Wed, 7 Feb 2018 14:28:48 +0100 Subject: [PATCH] Fix panic on nil messages (telegram). Closes #366 --- bridge/telegram/telegram.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go index 09622801..dfb596aa 100644 --- a/bridge/telegram/telegram.go +++ b/bridge/telegram/telegram.go @@ -134,6 +134,10 @@ func (b *Btelegram) Send(msg config.Message) (string, error) { func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { for update := range updates { flog.Debugf("Receiving from telegram: %#v", update.Message) + if update.Message == nil { + flog.Error("Getting nil messages, this shouldn't happen.") + continue + } var message *tgbotapi.Message username := "" channel := ""