Skip to content

Commit

Permalink
Add nil check for group update (telegram) (#2036)
Browse files Browse the repository at this point in the history
  • Loading branch information
yousefmansy1 authored Apr 5, 2023
1 parent 5bbe422 commit 574f253
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bridge/telegram/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit 574f253

Please sign in to comment.