5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-24 07:31:35 +00:00

Add nil check for group update (telegram) (#2036)

This commit is contained in:
Joseph Mansy 2023-04-05 14:08:03 -07:00 committed by GitHub
parent 5bbe422161
commit 574f25337d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -264,14 +264,14 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
} }
func (b *Btelegram) handleGroupUpdate(update tgbotapi.Update) { func (b *Btelegram) handleGroupUpdate(update tgbotapi.Update) {
msg := update.Message if msg := update.Message; msg != nil {
switch { switch {
case msg.NewChatMembers != nil: case msg.NewChatMembers != nil:
b.handleUserJoin(update) b.handleUserJoin(update)
case msg.LeftChatMember != nil: case msg.LeftChatMember != nil:
b.handleUserLeave(update) b.handleUserLeave(update)
} }
}
} }
func (b *Btelegram) handleUserJoin(update tgbotapi.Update) { func (b *Btelegram) handleUserJoin(update tgbotapi.Update) {