summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Mansy <36427684+yousefmansy1@users.noreply.github.com>2023-04-05 14:08:03 -0700
committerGitHub <noreply@github.com>2023-04-05 23:08:03 +0200
commit574f25337df2a3a7dbfa18093a4fcbe056b8824b (patch)
treef70621afe18d1a76863ca520ef16635c5d097046
parent5bbe422161a8b924ef502c7ae6d60b01cb02ae46 (diff)
downloadmatterbridge-msglm-574f25337df2a3a7dbfa18093a4fcbe056b8824b.tar.gz
matterbridge-msglm-574f25337df2a3a7dbfa18093a4fcbe056b8824b.tar.bz2
matterbridge-msglm-574f25337df2a3a7dbfa18093a4fcbe056b8824b.zip
Add nil check for group update (telegram) (#2036)
-rw-r--r--bridge/telegram/handlers.go14
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)
+ }
}
}