From 01d0a9f412d36562cc3accf6f7c0547c796b34b7 Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 5 Apr 2019 00:04:08 +0200 Subject: [PATCH] Handle nil message (telegram). Fixes #777 --- bridge/telegram/handlers.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go index fa8f2ffb..98b10207 100644 --- a/bridge/telegram/handlers.go +++ b/bridge/telegram/handlers.go @@ -125,6 +125,11 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { // handle groups message = b.handleGroups(&rmsg, message, update) + if message == nil { + b.Log.Error("message is nil, this shouldn't happen.") + continue + } + // set the ID's from the channel or group message rmsg.ID = strconv.Itoa(message.MessageID) rmsg.Channel = strconv.FormatInt(message.Chat.ID, 10)