diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go index efafa9d65c..8e7dc7ba81 100644 --- a/bridge/telegram/handlers.go +++ b/bridge/telegram/handlers.go @@ -264,13 +264,13 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { } func (b *Btelegram) handleGroupUpdate(update tgbotapi.Update) { - msg := update.Message - - switch { - case msg.NewChatMembers != nil: - b.handleUserJoin(update) - case msg.LeftChatMember != nil: - b.handleUserLeave(update) + if msg := update.Message; msg != nil { + switch { + case msg.NewChatMembers != nil: + b.handleUserJoin(update) + case msg.LeftChatMember != nil: + b.handleUserLeave(update) + } } }