diff options
author | Joseph Mansy <36427684+yousefmansy1@users.noreply.github.com> | 2023-04-05 14:08:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-05 23:08:03 +0200 |
commit | 574f25337df2a3a7dbfa18093a4fcbe056b8824b (patch) | |
tree | f70621afe18d1a76863ca520ef16635c5d097046 /bridge/telegram/handlers.go | |
parent | 5bbe422161a8b924ef502c7ae6d60b01cb02ae46 (diff) | |
download | matterbridge-msglm-574f25337df2a3a7dbfa18093a4fcbe056b8824b.tar.gz matterbridge-msglm-574f25337df2a3a7dbfa18093a4fcbe056b8824b.tar.bz2 matterbridge-msglm-574f25337df2a3a7dbfa18093a4fcbe056b8824b.zip |
Add nil check for group update (telegram) (#2036)
Diffstat (limited to 'bridge/telegram/handlers.go')
-rw-r--r-- | bridge/telegram/handlers.go | 14 |
1 files 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) + } } } |