summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-02-07 14:28:48 +0100
committerWim <wim@42.be>2018-02-07 14:28:48 +0100
commitdf5bce27b04e4942ca71a1d1d75c4cb73cdb39de (patch)
tree5ac8c70314f66936067e85ee09605cd5f2ec595d
parent2b15739b485a80c3cf20f171494b1c377814379d (diff)
downloadmatterbridge-msglm-df5bce27b04e4942ca71a1d1d75c4cb73cdb39de.tar.gz
matterbridge-msglm-df5bce27b04e4942ca71a1d1d75c4cb73cdb39de.tar.bz2
matterbridge-msglm-df5bce27b04e4942ca71a1d1d75c4cb73cdb39de.zip
Fix panic on nil messages (telegram). Closes #366
-rw-r--r--bridge/telegram/telegram.go4
1 files changed, 4 insertions, 0 deletions
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 := ""