From 574f25337df2a3a7dbfa18093a4fcbe056b8824b Mon Sep 17 00:00:00 2001 From: Joseph Mansy <36427684+yousefmansy1@users.noreply.github.com> Date: Wed, 5 Apr 2023 14:08:03 -0700 Subject: [PATCH] Add nil check for group update (telegram) (#2036) --- bridge/telegram/handlers.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go index efafa9d6..8e7dc7ba 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) + } } }