Fix panic on nil messages (telegram). Closes #366

This commit is contained in:
Wim 2018-02-07 14:28:48 +01:00
parent 2b15739b48
commit df5bce27b0
1 changed files with 4 additions and 0 deletions

View File

@ -134,6 +134,10 @@ func (b *Btelegram) Send(msg config.Message) (string, error) {
func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
for update := range updates { for update := range updates {
flog.Debugf("Receiving from telegram: %#v", update.Message) 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 var message *tgbotapi.Message
username := "" username := ""
channel := "" channel := ""